DB2 AS400

ID #1048

Utilisation des séquences sur DB2 400 avec v5r3

Utilisation des séquences sur DB2 400
(Nouveauté de la v5r3)

1) Création:

CREATE SEQUENCE TEST.ORDER_SEQ
START WITH 500
INCREMENT BY 1
MAXVALUE 1000
CYCLE
CACHE 24


2) Pour l'utiliser dans un SELECT:

SELECT NEXT VALUE FOR TEST.ORDER_SEQ FROM SYSIBM.SYSDUMMY1


3) Pour l'utiliser dans un INSERT:

INSERT INTO ORDERS (ORDERNO, CUSTNO)
VALUES (NEXT VALUE FOR TEST.ORDER_SEQ, 12)

Tags: -

Related entries:

Dernière mise à jour: 2007-12-29 20:15
Auteur: Michel Preti
Révision: 1.0

Digg it! Imprimer cet article Envoyer à un ami version PDF
Propose a translation for Propose a translation for
Merci de noter cette entrée:

Moyenne des notes: 0 sur 5 (0 Votes)

complètement inutile 1 2 3 4 5 indispensable

Vous ne pouvez pas commenter cet enregistrement

Commenté par HmfyqIKl:
We would like to thank you yet again for the beautiful ideas you gave Jesse when ppirareng a post-graduate research and also, most importantly, with regard to providing each of your ideas in one particular weblog post. If we had recognized of the web-site a year ago, we would have been rescued from the pointless measures we were selecting. Thank you pretty much.
Added at: 2015-12-21 09:19

Commenté par 0ALnLNJ81:
I have been browsing oinlne more than 3 hours today, but I by no means discovered any attention-grabbing article like yours. It is lovely worth enough for me. In my view, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.
Added at: 2015-12-22 19:19