Re: How to get value of serial column from PB5.0?
Posted in 1997
Grace Wu <grace_wu@bio-rad.com> wrote in article <01bc5f1c$34e49590$d4a2d3c6@gwu>... > 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 > In the SQLReturnData value You got serial value only when You use embeded SQL! You can "catch" inserts in datawindow and rewrite code or modify DB schema and use another table with serial column for getting unique values. Josef Dufek ISS Brno, Czech Republic jdufek@iss.cz