AW: VDataBase_CreateForeignKeyLink() - fault in Wiki?
Tiemo Hollmann TB
toolbook at kestner.de
Tue Mar 22 04:45:32 CDT 2011
Hi Ivan,
thank you, using the references instead of field names as you proposed did
the trick.
Is this a fault in the wiki and you want to correct it, or is this a
speciality of the LiveCode API, what the user just has to know?
Thanks
Tiemo
Von: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] Im Auftrag von Ivan Smahin
Gesendet: Freitag, 18. März 2011 13:29
An: valentina at lists.macserve.net
Betreff: Re: AW: AW: How to add multiple flags with createField?
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 ) into glinkRef
the log says: ERROR: Wrong ref for "inKeyFieldRef"
I have created the table and KeyField before, like:
put VDatabase_CreateTable(gDBRef, "begriff") into tblRef
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") into tblRef
put VTable_CreateShortField(tblRef, "begriff_ID", "fIndexed, fUnique") into
IDref
...
put VDatabase_CreateTable(gDBRef, "rubrik") into tblRubrikRef
put VTable_CreateShortField(tblRubrikRef, "begriff_ID", "fIndexed") into
Ptrref
...
put VDataBase_CreateForeignKeyLink(gDBRef, "link_begriff_rubrik", IDRef,
PtrRef ) into glinkRef
--
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/20110322/4ba49b73/attachment-0001.htm>
More information about the Valentina
mailing list