RE: How to get value of serial column from PB5.0?
Posted in 1997
----------
De: Grace Wu[SMTP:grace_wu@bio-rad.com]
Enviado: Lunes, Mayo 12, 1997 18:30
Para: informix-list@rmy.emory.edu
Asunto: How to get value of serial column from PB5.0?
This question is related to PowerBuilder, but I didn't really get any
answer from PB's newsgroup, so I am posting it here with the hope that
Informix/PB developers can give me a hand.
My environment: Informix 7.21 OnLine, PB 5.0, NT 4.0, Intersolv ODBC 2.13,
HP-UX 10.10
I have serial column on some tables, and my problem is I couldn't get the
serial value from PB after each inserted row. PB 5.0 has a 'identity
column' feature, which supposedly should bring back the new serial value
from Informix to PB. However, I don't know how to get the value. I had
tried to use GetItemNumber after the Insert to get the value, but got null
value. I also had tried to get the SQLCA.SQLReturnData value after the
insert, but it contained the text 'informix' instead of any numeric value.
Has anyone done this without any problem? What were your environment? I am
not sure is this a bug in PB or I just don't know how to get the value. If
I couldn't get this resolved, I have to modify my DB schema which I really
try to avoid. Any information is highly appreciated. Thanks in advance.
Please also reply to my email address if you reply to the newsgroup.
Thanks!
Grace Wu
Dear Grace:
One form that obtain the serial value is using stored procedure.
This procedure return the serial value;
create procedure serial_valor() returning int;
define var int;
insert into orders
(order_num, order_date) values (0,"04/01/97');
let var = dbinfo("sqlca.sqlerr1");
return var;
end procedure;
I hope help you.
Atte. Gabriel.