how to connect to oracle from unix and get the error code in unix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smitamahadik
    New Member
    • May 2007
    • 2

    how to connect to oracle from unix and get the error code in unix

    Hi,

    I need to connect to oracle from unix , excute a stored procedure and find out the error code if any in unix. Can somebody give detail commands to extract the error code?
  • chella
    New Member
    • Mar 2007
    • 51

    #2
    Originally posted by smitamahadik
    Hi,

    I need to connect to oracle from unix , excute a stored procedure and find out the error code if any in unix. Can somebody give detail commands to extract the error code?
    Hi,
    We can connect to Oracle from Unix just by giving the command sqlplus at the prompt and log into Oracle using the appropriate username and password.

    sqlplus -s userid/password@databa se
    In case you want to connect to SQL database

    sqsh -S Servername -U username -P password

    In case of SYBASE

    isql -S Servername -U username -P password

    Regards,
    Chella

    Comment

    • smitamahadik
      New Member
      • May 2007
      • 2

      #3
      found out a way to fetech the error code.
      Following will connect to oracle from unix and fetch the error code.

      sqlplus -S user/psswd@dbname<<E OC>/temp/sql-unix.log
      set feedback off
      set head off
      var rc number;
      exec proc_add_daily_ range_part('${T NAME}','${RUN_D T}',:rc);
      print :rc;
      EOC
      export error=`sed -e '/^$/d' /temp/sql-unix.log | sed 's/^[ ]*//g'`

      Comment

      Working...