------=_Part_27064_18091299.1207089816037
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I would like to increment one field, depending of the value of the
other. here=B4s an example:
id variable
1 1
2 1
1 2
2 2
can i do that with the following commands?
SELECT setval('sequence',(SELECT max(id) FROM table)) INTO variable;
insert into table values(variable, ..., ...); ?
Will this be transactional? Cause, they say that setval is a command
that its transactional. Using this way i
don=B4t will need to use a sequence anymore. Is that correct?
Thanks you all.
------=_Part_27064_18091299.1207089816037
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<pre><code>I would like to increment one field, depending of the value of
t=
he other. here=B4s an example:<br><br>id variable<br>1 1<br>2
=
1 <br>1 2 <br>2 2<br><br>can i do that with the following
comma=
nds?<br>
<br>SELECT setval('sequence',(SELECT max(id) FROM table)) INTO
vari=
able;<br>insert into table values(variable, ..., ...); ?<br><br>Will this
=
be transactional? Cause, they say that setval is a command that its
transac=
tional. Using this way i<br>
<br>don=B4t will need to use a sequence anymore. Is that
correct?<br><br><b=
r>Thanks you all.<br></code></pre>
------=_Part_27064_18091299.1207089816037--


|