开发者

Is it possible to join strings in PL/SQL procedure in my sql statement

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜