Código: Seleccionar todo
Access:ZEQ_243.Open
ZEQ_243{Prop:SQL}='Select ZEQ_243.Nextval from ZEQ_243'
IF ~Access:ZEQ_243.Next()
PAY:BATCHKEY=ZEQ:NEXTVAL
!MESSAGE(PAY:BATCHKEY)
END
segun el help:
Oracle Sequences:
To use Oracle Sequences:
1. Define an Oracle Sequence for the auto incremented key.
See your Oracle documentation:
CREATE SEQUENCE GlobalSequence
INCREMENT BY 1
START WITH 1
NOMAXVALUE
MINVALUE 1
NOCYCLE
CACHE 30;
2. Declare a Clarion file to receive the sequence number from the Oracle Sequence like this:
CustomerSequence FILE,DRIVER('ORACLE'),PRE(CUST),CREATE,THREAD
Record RECORD,PRE()
SequenceNo LONG
END
END
3. Assign the incremented sequence number to your key field by embedding the following in the WindowManager Method Executable Code Section - PrimeFields embed point:
Access:CustomerSequence.Open
CustomerSequence{Prop:SQL}='Select GlobalSequence.Nextval from dual'
IF ~Access:CustomerSequence.Next()
Cust:CustNo=SequenceNo
END
where Cust:CustNo is the label of your auto-incremented key field in your Oracle data file.
4. Set the embedded code priority to 7500.