logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: @@IDENTITY (Was: Access - ODBC - serial problem): msg#00072

db.postgresql.odbc

Subject: Re: @@IDENTITY (Was: Access - ODBC - serial problem)

On Fri, 9 Apr 2004, Dave Page wrote:

>
>
> > -----Original Message-----
> > From: Philippe Lang [mailto:philippe.lang@xxxxxxxxxxxxxx]
> > Sent: 09 April 2004 13:33
> > To: jorgens@xxxxxxxx; pgsql-odbc@xxxxxxxxxxxxxx
> > Subject: Re: [ODBC] Access - ODBC - serial problem...
> >
> > Is there a Postgresql ODBC driver guru that could give us an
> > idea for a driver modification? I don't know the exact job of
> > an ODBC driver, nor how it connects to Postgresql, so I
> > cannot tell if it would be possible to modify the ODBC
> > driver, and do something like a "SELECT @@IDENTITY" (which is
> > a SQL Server 2000 call, correct).
> >
> > Since Microsoft is behind both Access and SQL Server, maybe
> > nothing can be done in the driver itself, and I'll have to
> > handle my insertions by hand, through pl/pgsql. But really,
> > that's a serious limitation...
>
> SELECT CURRENT_USER;
>
> Though I suspect that is not what you want. Are you asking for the
> driver to translate '@@IDENTITY' into 'CURRENT_USER'?

For reasons unfathomable to modern man, Microsoft chose @@IDENTITY to
mean, not the current user, as I or you or any sane person would expect,
but to hold the incremented value of an autoincrementing column fed by an
insert. Another triumph in orthogonally named things from Microsoft.

Anyway, what the original conversation was about was getting back the auto
increment value from pgsql via ODBC with access on top. The problem being
that postgresql doesn't have a simple "what was the autoincrement I just
put in" but requires the user to either use the system catalogs to look up
the sequence name and then use currval on it, or something like a plpgsql
function to insert your data.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo