Home Oracle How to call Next Value in Sequence?
How to call Next Value in Sequence? PDF Print E-mail
Written by Siva   
Tuesday, 23 November 2010 10:00



What is sequence in oracle?

This is similar like Auto Number in MS Access.


We have 'sequence' called 'seq_comm'.

  • Whenever you call the sequence with .nextval, that brings current value + 1


Here sample is highlighted



SELECT 1050, Seq_comm.nextval,t_invoice_details.stock_id,

t_users.Name, t_Invoice_details.Invoice_ID, t_Invoices.Invoice_Date,

t_Invoices.comm_rate_1,'Primary', t_Invoice_Details.Price,

t_Invoice_Details.Quantity, t_clients.first_Name, t_clients.Last_Name,

t_Report_Data.Start_Date, t_Report_Data.End_Date,

t_Report_Data.Session_ID, t_Locations.location_name, t_invoices.source_doc_no

FROM t_Invoice_Details, t_Invoices, t_users, t_locations, t_clients, t_Report_Data

WHERE t_Invoice_Details.unit_id = 1050

and t_Invoice_Details.unit_id = t_report_data.unit_id

and t_Invoices.Invoice_Date >= t_Report_Data.Start_Date

and t_Invoices.Invoice_Date <= t_Report_Data.End_Date

and t_Invoice_Details.unit_id = t_users.unit_id

and t_Invoices.Associate1_ID = t_users.User_ID

and t_users.User_ID <> 0

and t_Invoice_Details.unit_id = t_locations.unit_id

and t_invoices.location_id = t_locations.location_id

and t_Invoice_Details.unit_id = t_clients.unit_id

and t_Invoices.Client_ID = t_clients.Client_ID

and t_invoices.unit_id = t_Invoice_details.unit_id

and t_Invoices.Invoice_ID = t_Invoice_Details.Invoice_ID;

Last Updated on Tuesday, 23 November 2010 10:03


Featured Links:
Looking for job? Try HREmail.com
Want to have CMS based Websites?
Try siliconwebcreators.com to CMS based websites.
VM Solutions Inc
For best VM solutions..
Digital Procedure Inc.
Looking for Oracle /SAP /Weblogic Consulting services? visit digitalprocedure.com