Hai
i want to connect to oracle database from user input and create a view.
${ECHO} "Debut Creating View"
${ECHO} "Please Enter the User Name:"
read user_name
${ECHO} "Please Enter the Connection String:"
read con_string
${ECHO} "Please Enter the Password:"
read pwd
${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string} CREATE_VIEW.sql
it is not working....
what's wrong ?
Kindly help
S
Whats the error your are getting . Pls post it
SQL*Plus: Release 10.2.0.4.0 - Production on Fri May 28 09:31:38 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
~
this error message i found in trace files
but when i run the same user name and passsword pop/pop@schema it works fine
S
ORA-12154: TNS:could not resolve the connect identifier specified
This error is a known error when tns could not resolve the target.
${ECHO} "Debut Creating View"
${ECHO} "Please Enter the User Name:"
read user_name
${ECHO} "Please Enter the Connection String:"
read con_string
${ECHO} "Please Enter the Password:"
read pwd
echo "${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string}"
${ORACLE_HOME}/bin/sqlplus -s ${user_name}/${pwd}@${con_string} CREATE_VIEW.sql
I have added a line to check the variables passed to sqlplus. Pls check if its taking the correct varibales.
Also as far as i remember i used bellow syntax to execute a sql script from ksh
sqlplus pop/pop@schema @CREATE_VIEW.sql