Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials) - Mailing list pgsql-general

From Karl Czajkowski
Subject Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)
Date
Msg-id 20170806002502.GA11648@moraine.isi.edu
Whole thread Raw
In response to Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)  ("Dan Cooperstock at Software4Nonprofits" <info@software4nonprofits.com>)
Responses Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)  ("Dan Cooperstock at Software4Nonprofits" <info@software4nonprofits.com>)
List pgsql-general
>   Select currval('GEN_&TableName')
>

From the above, I am assuming you did something like:

   CREATE SEQUENCE "GEN_&TableName" ...;

and are trying to access this sequence?  If so, you actually have to
include the SQL quoted identifier syntax within the text argument to
currval() or nextval(), e.g.

   SELECT nextval('"GEN_&TableName"');

With these sorts of identifier-as-argument parameters in Postgres, you
can also include schema-qualification syntax:

   SELECT nextval('"My Schema"."GEN_&TableName"');


Karl



pgsql-general by date:

Previous
From: Rick Widmer
Date:
Subject: Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys(serials)
Next
From: "Dan Cooperstock at Software4Nonprofits"
Date:
Subject: Re: [GENERAL] PostgreSQL with PowerBuilder, and Identity keys (serials)