Re: PostgreSQL with PowerBuilder, and Identity keys (serials)

From: Karl Czajkowski <karlcz(at)isi(dot)edu>
To: Dan Cooperstock at Software4Nonprofits <info(at)software4nonprofits(dot)com>
Cc: "'Rob Sargent'" <robjsargent(at)gmail(dot)com>, "'Forums postgresql'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL with PowerBuilder, and Identity keys (serials)
Date: 2017-08-06 00:25:02
Message-ID: 20170806002502.GA11648@moraine.isi.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Cooperstock at Software4Nonprofits 2017-08-06 00:52:25 Re: PostgreSQL with PowerBuilder, and Identity keys (serials)
Previous Message Rick Widmer 2017-08-06 00:22:31 Re: PostgreSQL with PowerBuilder, and Identity keys (serials)