AW: AW: How to add multiple flags with createField?

Ivan Smahin ivan_smahin at paradigmasoft.com
Fri Mar 18 07:29:08 CDT 2011


On 3/18/2011 2:29 PM, Tiemo Hollmann TB wrote:
>
> Hi Ivan,
>
> *put*VDataBase_CreateForeignKeyLink(gDBRef, "link_begriff_rubrik", 
> begriff.begriff_ID, rubrik.begriff_ID ) intoglinkRef
>
> the log says: ERROR: Wrong ref for "inKeyFieldRef"
>
> I have created the table and KeyField before, like:
>
> *put*VDatabase_CreateTable(gDBRef, "begriff") intotblRef
>
> *get*VTable_CreateShortField(tblRef, "begriff_ID", "fIndexed, fUnique")
>
> Am I missing a primary key? I f yes, how to create? There is no field 
> flag for primary key. Obviously I am missing again something
>
> Btw. Creating the same link in VStudio works without anything else
>
>

No 'unique' is enough to be a key.
I guess you need something like this instead:

*put*VDatabase_CreateTable(gDBRef, "begriff") intotblRef

*put*VTable_CreateShortField(tblRef, "begriff_ID", "fIndexed, fUnique") 
into IDref

...

*put*VDatabase_CreateTable(gDBRef, "rubrik") intotblRubrikRef

*put*VTable_CreateShortField(tblRubrikRef, "begriff_ID", "fIndexed") 
into Ptrref

...

*put*VDataBase_CreateForeignKeyLink(gDBRef, "link_begriff_rubrik", 
IDRef, PtrRef ) intoglinkRef



-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20110318/14054f98/attachment.htm>


More information about the Valentina mailing list