0

how to concatenate Login, pwd and @server variables ?? ex:

   export Login_va="Login"
   export pwd_va="pwd"
   export server_var="@server"

       echo whenever sqlerror exit | sqlplus $Login/$Passwd$@SERVER @"TABLE1.sql"

echo 'return code : ' $?

any help?

  • What is your expectation? – tachomi Feb 12 '16 at 16:10
  • 1
    you'll get a lot closer by using the same variable names in both places... – Jeff Schaller Feb 12 '16 at 16:16
1

Use curly braces

export Login_va="Login"
export pwd_va="pwd"
export server_var="@server"

echo whenever sqlerror exit | sqlplus "${Login_va}${pwd_va}${server_va}" @"TABLE1.sql"

echo 'return code : ' $?

See a little explanation about curly braces in here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.