By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,512 Members | 791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,512 IT Pros & Developers. It's quick & easy.

insert statement question

P: n/a
Hi
is there any way to revice value of autoincrement column.

lets suppose that we have to tables:

1. document (id serial)
2. document_positions( id serial, document_id)

if user will insert some data to first table (docyment)
i need to use this id when adding positions of this document.

app will work in multiuser enviroment.

Regards, Robert
Aug 14 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
RobertK wrote:
Hi
is there any way to revice value of autoincrement column.

lets suppose that we have to tables:

1. document (id serial)
2. document_positions( id serial, document_id)

if user will insert some data to first table (docyment)
i need to use this id when adding positions of this document.

app will work in multiuser enviroment.

Regards, Robert

i have solved my problem:
select currval('sequence_name') as current_value;

this will return current value for given sequence for
current user session.

Regards, RobertK
Aug 14 '05 #2

P: n/a
In article <dd**********@atlantis.news.tpi.pl>,
RobertK <sf****@interia.pl> wrote:
RobertK wrote:
Hi
is there any way to revice value of autoincrement column.

lets suppose that we have to tables:

1. document (id serial)
2. document_positions( id serial, document_id)

if user will insert some data to first table (docyment)
i need to use this id when adding positions of this document.

app will work in multiuser enviroment.

Regards, Robert

i have solved my problem:
select currval('sequence_name') as current_value;

this will return current value for given sequence for
current user session.

Regards, RobertK

Thanks for posting your answer! A lot of people ask, figure it out, and
then don't bother to tell the rest of us!

--
Available for Hire! http://amduus.com/Resumes/
Aug 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.