Gregg
|
| Posted: 09/30/2002, 7:39 AM |
|
I NEED HELP
I have tried:
g_srv_request_id = CCExecSQL("SELECT @@IDENTITY", DBisoperations, "ShowError")
This only return error messages.
I need to return the SQL query result from "SELECT @@IDENTITY" in a AfterInsert Event to a variable.
Using
ASP
IIS 5.0
CCS 1.07
Thanks
gb
|
|
|
 |
EMG
|
| Posted: 09/30/2002, 10:45 AM |
|
try this sql with a get db value function. Insert you table name and primary key column name into the tagged places.
select @@identity as lastpk from <table_name> where <pk_field> = @@identity
I assume your using MSSQL. Hope this works for ya.
|
|
|
 |
Gregg
|
| Posted: 10/02/2002, 1:06 PM |
|
Do you mean a CCS get db function? I could not find one in CCS.
gb
|
|
|
 |
RonB
|
| Posted: 10/03/2002, 4:22 AM |
|
CCGetDBValue($sql,$DBConnection)
|
|
|
 |
Gregg
|
| Posted: 10/03/2002, 5:13 AM |
|
I'm using ASP not PHP. I don't see that function in ASP... and I don't which function would be the ASP equivalent of the PHP CCGetDBValue($sql,$DBConnection) .
Using:
ASP
IIS 5.0
CCS 1.07
MS SQL
Thanks
Gregg
|
|
|
 |
Gregg
|
| Posted: 10/04/2002, 8:00 AM |
|
Thanks to EMG I found an ASP fuction that worked.
Solution:
g_srv_request_id = CCDLookUp("@@IDENTITY", "farmsrvreq", "srv_request_id=@@IDENTITY", DBisoperations)
This will return the newly generated "_id" field value after a record has been "INSERTED" into the table. I have this code placed in the "AfterInsert" Event.
|
|
|
 |