tags:

views:

48

answers:

1

As the title suggests, I would like to know if it is possible to join the string in a select statement within a PL/SQL procedure.

For example, I have something like this

SELECT FCS.CATEGORY, 
       FCS.NUMBERS, 
       FCS.POINTS 
 WHERE FCS.OBJECT = 'T' 
   AND FCS.THIS_DB & strSelectedDB & 

So, is it possible to do something like this?

+2  A: 

Your example is a little confusing. You can concatenate multiple strings using the || operator. But you'd then you'd have to compare the concatenated string to something. You can compare columns to local variables directly, though, i.e.

SELECT fcs.category,
       fcs.numbers,
       fcs.points
  FROM some_table fcs
 WHERE fcs.object  = 'T'
   AND fcs.this_db = strSelectedDB

assuming that strSelectedDB is a local variable in your PL/SQL block.

Justin Cave
Of course this is also a way;) thank you.
jovany