Re: Selecting Next X Values From Dual
You may find this article interesting: http://otn.oracle.com/oramag/oracle/02-sep/o52sql.html Jared Gary Chambers [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 09/27/2002 11:53 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:Re: Selecting Next X Values From Dual Stephane... Thanks for the reply. SELECT sequence.nextval FROM table WHERE ROWNUM x It just seems too kludgy, and I didn't think creating a table with dummy data for the count would be a good way to go. Any suggestions? Why 'too kludgy' ? If you are inside a PL/SQL package have you though of a bulk collect into an array of numbers? It seems kludgy to me to have a table of n-rows of dummy data to grab a specific number of values from a sequence. Is this a common practice? Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gary Chambers INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Selecting Next X Values From Dual
If X is fixed for all sessions, do a step increase of X so that you only have to select 1 row from dual. Anjo. On Friday 27 September 2002 00:18, you wrote: All... Is there a method by which I can select the next x values from a sequence from dual? I've searched Google and OraFAQs.com, but I can't seem to make any hits on my search request. TIA Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Anjo Kolk http://www.oraperf.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Anjo Kolk INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Selecting Next X Values From Dual
Anjo... Thanks for the reply!! If X is fixed for all sessions, do a step increase of X so that you only have to select 1 row from dual. Unfortunately, I don't feel I can do that. I'm using the returned values as unique identifiers to protect against duplicate database submissions from a web-based application. I have implemented a workaround by selecting a row from dual X number of times. I wanted something a bit cleaner, and [seemingly] less database-intensive than querying in a loop. Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gary Chambers INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Selecting Next X Values From Dual
I created a package that would easily loop thru and select x number of entries, but not return them in a select to you. This way, you can make 1 simple call passing it X. Is that what you wanted ??? Or do you have to have them as returned values of a select ? Kevin -Original Message- Sent: Friday, September 27, 2002 2:38 PM To: Multiple recipients of list ORACLE-L Anjo... Thanks for the reply!! If X is fixed for all sessions, do a step increase of X so that you only have to select 1 row from dual. Unfortunately, I don't feel I can do that. I'm using the returned values as unique identifiers to protect against duplicate database submissions from a web-based application. I have implemented a workaround by selecting a row from dual X number of times. I wanted something a bit cleaner, and [seemingly] less database-intensive than querying in a loop. Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gary Chambers INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Selecting Next X Values From Dual
I created a package that would easily loop thru and select x number of entries, but not return them in a select to you. This way, you can make 1 simple call passing it X. Is that what you wanted ??? Or do you have to have them as returned values of a select ? I would need the values returned through select, if I'm correctly understanding you (it's a web-based application). I thought of doing something like: SELECT sequence.nextval FROM table WHERE ROWNUM x It just seems too kludgy, and I didn't think creating a table with dummy data for the count would be a good way to go. Any suggestions? Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gary Chambers INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Selecting Next X Values From Dual
Gary Chambers wrote: I created a package that would easily loop thru and select x number of entries, but not return them in a select to you. This way, you can make 1 simple call passing it X. Is that what you wanted ??? Or do you have to have them as returned values of a select ? I would need the values returned through select, if I'm correctly understanding you (it's a web-based application). I thought of doing something like: SELECT sequence.nextval FROM table WHERE ROWNUM x It just seems too kludgy, and I didn't think creating a table with dummy data for the count would be a good way to go. Any suggestions? Why 'too kludgy' ? If you are inside a PL/SQL package have you though of a bulk collect into an array of numbers? -- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Selecting Next X Values From Dual
Stephane... Thanks for the reply. SELECT sequence.nextval FROM table WHERE ROWNUM x It just seems too kludgy, and I didn't think creating a table with dummy data for the count would be a good way to go. Any suggestions? Why 'too kludgy' ? If you are inside a PL/SQL package have you though of a bulk collect into an array of numbers? It seems kludgy to me to have a table of n-rows of dummy data to grab a specific number of values from a sequence. Is this a common practice? Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gary Chambers INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Selecting Next X Values From Dual
Gary Chambers wrote: All... Is there a method by which I can select the next x values from a sequence from dual? I've searched Google and OraFAQs.com, but I can't seem to make any hits on my search request. TIA Gary Chambers //- // Lucent Technologies GIO/Unix // 4 Robbins Road, Westford, MA 01886 // 978-399-0481 / 888-480-6924 (Pager) // Nothing fancy and nothing Microsoft //- Gary, You do not have to use dual. select myseq.nexval from dictionary where rownum x + 1 can return the x next values for a fairly high value of x. -- Regards, Stephane Faroult Oriole Software -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).