Re: SQL Help - Obtaining ID of record INSERTED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You got the suggestion using currval already so here's one alternative.

	SELECT NEXTVAL('"orderid_sequence_name"');

Assume this value is $val then do 

	INSERT INTO orderstemp(orderid,...) VALUES ($val, ...);

I'm not sure if this is generally used, but this works and sometimes this
way is convenient for batch processing.

>SELECT @@identity as orderid

My 0.02$.

Regards,

Ben Kim
Developer
College of Education 
Texas A&M University



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux