Search Postgresql Archives

how to create a sequence in a stored proc?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I need to create a sequence in a stored procedure.

First I need to select a value from a table and set the sequence start value to that value.

We have a table that does not have a sequence on it, so I want to select the max value, increment by one
and then start the sequence there.

We have to do this on three databases, I have figured out how to do this in Oracle (build a string and the EXECUTE IMMEDIATE <myString>, but have not figured out how to do this with PostgreSQL.

any ideas?

thanks


J.V.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux