You know, that's funny.  I had been using this code forever to get the last identity 
on Sybase and SQL server.  Then I used it for the first time on Sybase using the 
native Sybase driver on CF Enterprise, only to find out that it didn't work.  It 
appeared that Set Nocount On and Set Nocount Off produced a data error.  Anyone had 
luck running this same code using native drivers for Sybase?

Thanks,
Ross.

>
> I think Clint got it right. Here's an example:
>
> <cfquery name="addcompany" datasource="#application.dbcontact#">
>      SET NOCOUNT ON;
>      INSERT INTO tblCompany (comp_name, comp_city, comp_stateprov, comp_country, 
>comp_postalcode, comp_dnb_annrev, comp_revcurr, comp_dnb_swh,
> search_name, last_updt, updt_date)
>      VALUES ('#Trim(Fields.CompanyName)#', '#Trim(Fields.CompanyCity)#', 
>#Trim(Form.dd2)#, #Trim(Form.dd1)#, '#Trim(Fields.CompanyPostalCode)#',
> #Trim(Fields.CompanySales)#, '#Trim(Fields.CompanyCurr)#', 1, 
>'#getSearchName.name#', '#LastUpdt#', getdate());
>      SELECT @@IDENTITY as company_id;
> </cfquery>
>
> If you need the id: <cfset aVar = #addCompany.company_id#>
>
> You can easily get the ID from an SP as well.
>
> Phil
>
>
>
> This transmission may contain information that is privileged, confidential and/or 
>exempt from disclosure under applicable law. If you are not the intended recipient, 
>you are hereby notified that any disclosure, copying, distribution, or use of the 
>information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
>If you received this transmission in error, please immediately contact the sender and 
>destroy the material in its entirety, whether in electronic or hard copy format. 
>Thank you.
>
>
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com
>
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to