INSERT INTO ... getNextID

Help is preferred to those who publish their work as Open Source and not as private branches rejecting collaboration. Such projects are not maintainable and shall be deleted.
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are grouped together. IF YOU HAVE REGISTERED, you need to send email to red1(a)red1.org with your username in the subject title to get me to activate you.

INSERT INTO ... getNextID

Postby nmicoud » Sat Aug 04, 2012 9:46 pm

Hi everyone,

I've added a T_ table to store records generated by process (using sql and java to fill it) in order to show them in reports (Jasper or standard).
This table has a lot of columns (including mandatory ones and ID).

A report take a very long time to generate and i modify process in order to remove java and only doing it via sql. Performance is greater so i would like to go on this way.
But i cannot manage to fill ID column. My sql statement looks like "INSERT INTO T_Nico_Report (...) SELECT ... ".

I'd prefer to keep working on this table. And my question is, how can i get and update sequence for this table within a sql statement ? (working on oracle)
I've tried to call nextID and AD_Sequence_Next but never managed to succeed.

Any ideas or exemple ?

Thanks,

Nicolas
nmicoud
Regular
 
Posts: 137
Joined: Fri Oct 07, 2011 6:19 pm

Re: INSERT INTO ... getNextID

Postby globalqss » Tue Aug 07, 2012 10:17 am

Nicolas, on oracle there is a function nextIDFunc

Regards,

Carlos Ruiz
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: INSERT INTO ... getNextID

Postby nmicoud » Tue Aug 07, 2012 2:04 pm

Thanks Carlos for the tip ; in the meantime, i've tried using oracle sequences and it seems working fine, even if multiple users launch reports simultaneously.
The nexiID function does the same ?
Thanks,

Nicolas
nmicoud
Regular
 
Posts: 137
Joined: Fri Oct 07, 2011 6:19 pm


Return to HELP ME!!!

Who is online

Users browsing this forum: No registered users and 2 guests

cron