"Sven K�hler" <[EMAIL PROTECTED]> wrote in message
av1f67$12t$[EMAIL PROTECTED]">news:av1f67$12t$[EMAIL PROTECTED]...
> > That is great, but is it possible to obtain last inserted value with
query
> > that
> > doesn't depend on table name?
> >
> > P.S.
> > Something like: "SELECT $currval FROM SYSDBA.DUAL" ;-)
>
> You could assign the CURRVAL-value to a variable after each INSERT
> statement. But that wouldn't work on tables without an SERIAL column.
>
> You might also walk the hard way, and try to analyse each INSERT
> statement to extract the table-name and save that for the call to the
> getID()-method.

Yes, this second method is better for me (I was thinking about this method
when you told me about sysdba.dual thing), I will probably do something
like:

if(query string begins with "INSERT INTO ")
    lastTableName = get query after "INSERT INTO " till " " or "(" or
"VALUES";

in query part of class and use lastTableName in getID() method...

I will think these days about "parser" part (upper "parser" is only simple
example)...

Thanks Sven!

Regards,
Vladislav Bjelic






_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to