I have a variable defined as
define dbs '&1'
Suppose I pass database1
as an argument. Then the statement is interpreted 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?
The CONCAT function allows you to concatenate two strings together. To CONCAT more than two values, we can nest multiple CONCAT function calls. Parameters Used: string1: It is used to specify the first string to concatenate.
Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs.
The Oracle/PLSQL || operator allows you to concatenate 2 or more strings together.
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' || ''''
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With