Help Required: To run the attached UNIX script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shrutikhungar
    New Member
    • Mar 2007
    • 4

    Help Required: To run the attached UNIX script

    Am getting this "SP2-0734:: not found" error while runnning following script. Please help.

    echo "Enter the CUSTOMER ID, CUSTOMER NAME AND FM/CH:"
    read cust_id;
    read cust_name;
    read fm_ch;

    echo "**";
    echo $cust_id;
    echo $cust_name;
    echo $fm_ch;

    `sqlplus -s itm_odb/itm_odb<<EOF
    set serveroutput on feedback off linesize 1000 pagesize 0;
    echo "heloo";
    insert into customer_tbl values('$cust_i d','$cust_id',' $cust_name','$f m_ch','sysdate' ,'sysdate');
    EXIT;
    EOF
    `
  • michaelb
    Recognized Expert Contributor
    • Nov 2006
    • 534

    #2
    I think you need to get rid of the backticks around the entire sqlplus command,
    and also echo "hello" seems to be misplaced - take it out.

    Comment

    • michaelb
      Recognized Expert Contributor
      • Nov 2006
      • 534

      #3
      Almost forgot about what very well may be your very first problem:

      Unless you have ORACLE_SID set in your environment your login string in the script should probably include the oracle instance. This means that you need to change

      sqlplus -s itm_odb/itm_odb
      to
      sqlplus -s itm_odb/itm_odb@oracle_ instance_name

      where oracle_instance _name is the actual name of the database instance you connecting to.

      Comment

      • shrutikhungar
        New Member
        • Mar 2007
        • 4

        #4
        Thanks for the reply!
        I have modified the statements as per your suggesrtions:
        Now it is giving some "./rulesEngine.ksh[21]: insert: not found" error. (name of the script file is "rulesEngine.ks h")

        Please help!

        echo "Enter the CUSTOMER ID, CUSTOMER NAME AND FM/CH:"
        read cust_id;
        read cust_name;
        read fm_ch;

        echo "**";
        echo $cust_id;
        echo $cust_name;
        echo $fm_ch;

        sqlplus -s itm_odb/itm_odb@fleetod b@ad.infosys.co m<<EOF
        set serveroutput on feedback off linesize 1000 pagesize 0;
        insert into customer_tbl values('$cust_i d','$cust_id',' $cust_name','$f m_ch','sysdate' ,'sysdate');
        commit;
        EXIT;
        EOF
        `
        --------------------------------------
        Your Reply:

        Originally posted by michaelb
        Almost forgot about what very well may be your very first problem:

        Unless you have ORACLE_SID set in your environment your login string in the script should probably include the oracle instance. This means that you need to change

        sqlplus -s itm_odb/itm_odb
        to
        sqlplus -s itm_odb/itm_odb@oracle_ instance_name

        where oracle_instance _name is the actual name of the database instance you connecting to.

        Comment

        • michaelb
          Recognized Expert Contributor
          • Nov 2006
          • 534

          #5
          First, check your script for typos. One thing I noticed, you seem to have a stray backtick character following the line with EOF.

          There could be more to it, I would expect a different error if backtick was the only problem in the script.

          Comment

          • shrutikhungar
            New Member
            • Mar 2007
            • 4

            #6
            Thanks for bringing it to my notice. I have removed all the backtick character from my script file. Now also it is not working:(

            Please suggest!

            Thanks,
            Shruti

            -------------------------------------------
            your reply:
            Originally posted by michaelb
            First, check your script for typos. One thing I noticed, you seem to have a stray backtick character following the line with EOF.

            There could be more to it, I would expect a different error if backtick was the only problem in the script.

            Comment

            • Motoma
              Recognized Expert Specialist
              • Jan 2007
              • 3236

              #7
              How isn't it working. Are you getting any error messages? Have you tried entering the commands, exactly as they appear in the script, directly on the command line?


              Originally posted by shrutikhungar
              Thanks for bringing it to my notice. I have removed all the backtick character from my script file. Now also it is not working:(

              Please suggest!

              Thanks,
              Shruti

              -------------------------------------------
              your reply:

              Comment

              Working...