开发者

How to perform string concatenation in PL/SQL?

I have a variable defined as

define dbs '&1'

Suppose I pass database1 as an argument. Then the statement is int开发者_如何学运维erpreted as

define dbs database1

I want to append single quotes around the string, ie I want it to be interpreted as

define dbs 'database1'

How should I do this?


Single quotes in strings need to be escaped with another single quote, so you would write (if I understand macro expansion correctly)

 '''&1'''

String concatenation is done with the || operator

 '''' || '&1' || ''''
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜