dbTalk Databases Forums  

SELECT Question

comp.databases.oracle.server comp.databases.oracle.server


Discuss SELECT Question in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mtek
 
Posts: n/a

Default SELECT Question - 06-17-2008 , 11:27 AM







Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? How would you do that? The column in
the table is numeric. Do I have to 'build' the select statement?

Thanks!

John

Reply With Quote
  #2  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM






On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #3  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #4  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #5  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #6  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #7  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #8  
Old   
gazzag
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:35 AM



On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? *How would you do that? *The column in
the table is numeric. *Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g


Reply With Quote
  #9  
Old   
Shakespeare
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:40 AM




"gazzag" <gareth (AT) jamms (DOT) org> schreef in bericht
news:d4eb97aa-40e8-468d-b9e7-df0451a39d69 (AT) x41g2000hsb (DOT) googlegroups.com...
On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? How would you do that? The column in
the table is numeric. Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g

-------------------------------------
Or write a function returning 1 if the value is ok, 0 if not and use

where your_function(var) = 1;


You can't build an index on it, though (not even function based, because the
function is not deterministic)

Shakespeare




Reply With Quote
  #10  
Old   
Shakespeare
 
Posts: n/a

Default Re: SELECT Question - 06-17-2008 , 11:40 AM




"gazzag" <gareth (AT) jamms (DOT) org> schreef in bericht
news:d4eb97aa-40e8-468d-b9e7-df0451a39d69 (AT) x41g2000hsb (DOT) googlegroups.com...
On 17 Jun, 17:27, Mtek <m... (AT) mtekusa (DOT) com> wrote:
Quote:
Hi,

Quick question here, if I have a WHERE clause with an IN condition -
WHERE var IN (1, 2, 3)......

What if the list is dynamic? How would you do that? The column in
the table is numeric. Do I have to 'build' the select statement?

Thanks!

John
Look into EXECUTE IMMEDIATE and wave scalability goodbye

-g

-------------------------------------
Or write a function returning 1 if the value is ok, 0 if not and use

where your_function(var) = 1;


You can't build an index on it, though (not even function based, because the
function is not deterministic)

Shakespeare




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.