Hi!

As I did not find any helpful information at all on this subject, I am
posting my questions here.

I have an application based on PostgreSQL using simple insert, update and
select statements, which I have to migrate to Cache5. All of my insert
statements us a sequence and a nextVal-function.
So I have statements like:

INSERT INTO VLP_COUNTRY VALUES (nextVal('VLCOU_SEQ'), 'AUSTRIA', 'AT',
'init', LOCALTIMESTAMP, 'init', LOCALTIMESTAMP);

I need to find a way to do this with Cache5 too.

I read a lot about $INCREMENT and global variables. But I am not able to set
a global variable or use any routine setting and incrementing global
variables from stored procedures (or at least I couldn't find any
information on that).

eg. I have
Class User.VLPSALUTATIONS Extends %Persistent [ ClassType = persistent,
DdlAllowed, Owner = portal, SqlRowIdPrivate, SqlTableName =
VLP_SALUTATIONS ]
{

ClassMethod nextVal() As %Integer [ SqlProc ]
{
    QUIT %INCREMENT(^Sequences("VLSAL_SEQ"))
}
}

Calling
select vlpsaluations.nextVal() from vlp_salutations
throws an error. If my nextVal function simply returns any fixed value, it
works.

Any help will be greatly appreciated!



Reply via email to