Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Tom Lane
Andrew Sullivan <[EMAIL PROTECTED]> writes: > On Fri, Feb 02, 2007 at 01:38:40PM -0600, Demel, Jeff wrote: SCOPE_IDENTITY() method is going to work or not. >>> I doubt it. What does it do? >> >> It returns the id of the record just inserted. > Ah. Well, there's no in-principle notion if "

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Andrew Sullivan
On Fri, Feb 02, 2007 at 01:38:40PM -0600, Demel, Jeff wrote: > Not as far as I know. What's it supposed to do? > > It suppresses the rowcount returned after the query runs. There isn't a way to do that, although there is a way in psql, for example, not to get all that formatting. You want the \

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Demel, Jeff
> 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? Andrew wrote: Not as far as I know. What's it supposed to do? It suppresses the rowcount returned after the query runs. > I haven't gotten there yet,

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Andrew Sullivan
On Fri, Feb 02, 2007 at 11:49:30AM -0600, Demel, Jeff wrote: > 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? Not as far as I know. What's it supposed to do? > I haven't gotten there yet, but I'm also

[SQL] Nocount and scope_identity()

2007-02-02 Thread Demel, Jeff
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 supporte