Nocount and scope_identity()

From: "Demel, Jeff" <Jeff(dot)Demel(at)JavelinDirect(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Nocount and scope_identity()
Date: 2007-02-02 17:49:30
Message-ID: 136ED738BD4F1545B97E4AC06FF6370734C25B@DMSP-MSG-EVS01.mail.pvt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm converting a MSSQL query to postgresql. It's something like this:

SET NOCOUNT ON;
INSERT INTO table_name([list]) VALUES([list]);
SELECT SCOPE_IDENTITY() as newId;

I get an error on the NOCOUNT statement:
"syntax error at or near "on" at character 13"

So, I'm wondering if NOCOUNT is supported in Postgres at all. If it's
not, what's the alternative? If it is, what is wrong with my syntax?

I haven't gotten there yet, but I'm also wondering if the
SCOPE_IDENTITY() method is going to work or not.

TIA

-Jeff
This email is intended only for the individual or entity to which it is addressed. This email may contain information that is privileged, confidential or otherwise protected from disclosure. Dissemination, distribution or copying of this e-mail or any attachments by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is prohibited. If you are not the intended recipient of this message or the employee or agent responsible for delivery of this email to the intended recipient, please notify the sender by replying to this message and then delete it from your system. Any use, dissemination, distribution, or reproduction of this message by unintended recipients is strictly prohibited and may be unlawful.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ezequias Rodrigues da Rocha 2007-02-02 18:11:22 to_chat(bigint)
Previous Message Andrew Sullivan 2007-02-02 15:16:44 Re: Duplicate records