Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec() will no longer create generator in FireBird
Message
From
15/07/2006 08:07:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Firebird
Miscellaneous
Thread ID:
01136637
Message ID:
01136655
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
Bhavbhuti,
As you already know I don't know Firebird:) This one took my attention:

">*** we are overriding the parent logic for FireBird databases
>*** we are also assuming that the generator is named as follows
>*** gen_maccounts_iid"

and later in error:

"GEN_MSERVICEOFFICE_IID is not defined"

Do you think it's only VFP version that has changed? It looks like there is something wrong in assumption.
Cetin


>Hi all
>
>I have the following, previously working function to generate a remote back-end PK. It no longer works in VFP9 (was working in VFP6). Please advise what am I missing here. I am sure I have not changed anything for the back-end recently.
>
>
LPARAMETERS tcBaseTable
>
>LOCAL lnConHnd, lnOldArea, luRetVal
>
>*** we are overriding the parent logic for FireBird databases
>*** we are also assuming that the generator is named as follows
>*** gen_maccounts_iid
>
>lnOldArea = SELECT(0)
>
>lnConnHnd = CURSORGETPROP("ConnectHandle")
>
>SQLEXEC(lnConnHnd , [SELECT gen_id(GEN_] + STRTRAN(tcBaseTable, "DBO.", "") ;
>	+ [_IID, 1) AS nNextId from rdb$database])
>
>*** 15/07/2006 new VFP9 behaviour will not return an empty cursor
>IF USED("sqlResult")
>	luRetVal = VAL(sqlResult.nNextID)
>ELSE
>	*** 15/07/2006 FB return such a number(?) to signify non-existant generator
>	luRetVal = 2147483647 + 1
>ENDIF
>
>
>*** If going beyond the Integer values
>IF NOT BETWEEN(luRetVal, -2147483647, 2147483647)
>	luRetVal = 1
>
>	SQLEXEC(lnConnHnd , [SET GENERATOR GEN_] + STRTRAN(tcBaseTable, "DBO.", "") ;
>		+ [_IID TO 1])
>lncnt = AERROR(laerr)
>FOR lni = 1 TO lncnt
>WAIT WINDOW laerr[lni, 1]  && 1526
>WAIT WINDOW laerr[lni, 2]  && Connectivity error: invalid request BLR at offset 25 generator GEN_MSERVICEOFFICE_IID is not defined
>WAIT WINDOW laerr[lni, 3]  && invalid request BLR at offset 25 generator GEN_MSERVICEOFFICE_IID is not defined
>WAIT WINDOW laerr[lni, 4]  && HY000
>WAIT WINDOW laerr[lni, 5]  && 335544343
>WAIT WINDOW laerr[lni, 6]  && 3
>WAIT WINDOW laerr[lni, 7]  && .NULL.
>endfor
>ENDIF
>
>CloseUsed("sqlResult")
>
>SELECT (lnOldArea)
>
>RETURN luRetVal
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform