5

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?

1 Answer 1

18

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' || ''''
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.