Home » Infrastructure » Linux » Calling .ksh from Oracle 8i pl/sql bolck (Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi)
Calling .ksh from Oracle 8i pl/sql bolck [message #516937] Thu, 21 July 2011 08:18 Go to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
hi Experts,

I am trying to call pl/sql anonymous block from .ksh script i.e.


 sqlplus -s abc/abc  << end_of_sql  2> /dev/null

  begin
      insert into ss1 values('10');
      commit;
  end;
end_of_sql



ss1 table structure is :


create table ss1(sno varchar2(20));



Please help me,its urgent;
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516941 is a reply to message #516937] Thu, 21 July 2011 08:20 Go to previous messageGo to next message
cookiemonster
Messages: 13787
Registered: September 2008
Location: Rainy Manchester
Senior Member
As usual, it'd help if you told us what the actual problem is. Are you getting an error?
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516942 is a reply to message #516937] Thu, 21 July 2011 08:21 Go to previous messageGo to next message
Michel Cadot
Messages: 66800
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Please help me,its urgent

Why is it urgent?

Maybe what is more urgent is to tell us what is your problem?

Regards
Michel
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516944 is a reply to message #516942] Thu, 21 July 2011 08:23 Go to previous messageGo to next message
BlackSwan
Messages: 26649
Registered: January 2009
Location: SoCal
Senior Member
>I am trying to call pl/sql anonymous block from .ksh script i.e.
WHY invoking PL/SQL to do only vanilla SQL?

It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516947 is a reply to message #516944] Thu, 21 July 2011 08:27 Go to previous messageGo to next message
cookiemonster
Messages: 13787
Registered: September 2008
Location: Rainy Manchester
Senior Member
Also it'd be an idea to use an apropriate title. You've copied one from one of your previous threads (I almost merged this into it), but the title describes the exact opposite of what you are currently trying to do.
It also talks about 8i, but the version info you have supplied for this thread stats 10g.
So which version are you actually using?
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516949 is a reply to message #516944] Thu, 21 July 2011 08:28 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
I m able to call :


sqlplus -s pirm_owner/pirm_owner  << end_of_sql  2> /dev/null

  insert into ss1 values(10);
  commit;

end_of_sql



But i think,i am doing mistake for calling pl/sql block.

Actually my requirement is to call one row one column table value into unix variable.

Please help me.
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516950 is a reply to message #516937] Thu, 21 July 2011 08:29 Go to previous messageGo to next message
joy_division
Messages: 4949
Registered: February 2005
Location: East Coast USA
Senior Member
msol25 wrote on Thu, 21 July 2011 09:18

Please help me,its urgent;


Yes, it seems very urgent to be able to insert a value of '10' into a table. I am willing to do it for $150 per hour USD if it is so urgent.
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516952 is a reply to message #516950] Thu, 21 July 2011 08:35 Go to previous messageGo to next message
BlackSwan
Messages: 26649
Registered: January 2009
Location: SoCal
Senior Member
>Actually my requirement is to call one row one column table value into unix variable.
SELECT is required
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516953 is a reply to message #516949] Thu, 21 July 2011 08:36 Go to previous messageGo to next message
cookiemonster
Messages: 13787
Registered: September 2008
Location: Rainy Manchester
Senior Member
msol25 wrote on Thu, 21 July 2011 14:28
I m able to call :


sqlplus -s pirm_owner/pirm_owner  << end_of_sql  2> /dev/null

  insert into ss1 values(10);
  commit;

end_of_sql



But i think,i am doing mistake for calling pl/sql block.

Actually my requirement is to call one row one column table value into unix variable.

Please help me.


So your intial post has nothing to do with your actual problem since really you need a select?
Words fail me.

VARIABLE=`sqlplus -s username/pass <<EOF
          set pagesize 0
          select to_char(SYSDATE, 'YYYYMMDDHH24MISS') from dual;
          exit;
EOF`

Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516957 is a reply to message #516953] Thu, 21 July 2011 08:43 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Thanks Cookiemaster,

Problem reolved.
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516958 is a reply to message #516957] Thu, 21 July 2011 08:47 Go to previous messageGo to next message
cookiemonster
Messages: 13787
Registered: September 2008
Location: Rainy Manchester
Senior Member
Before you post your next problem here I strongly suggest to take a few minutes to review what you write and check that it actually describles the problem you are facing.
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516961 is a reply to message #516958] Thu, 21 July 2011 08:58 Go to previous messageGo to next message
Michel Cadot
Messages: 66800
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And also to post it in the appropriate forum as this has nothing to do with SQL or PL/SQL but with Unix script.
In addition, you should think about searching as this has already been answered many and many times.

Regards
Michel
Re: Calling .ksh from Oracle 8i pl/sql bolck [message #516965 is a reply to message #516961] Thu, 21 July 2011 09:02 Go to previous message
msol25
Messages: 396
Registered: June 2011
Senior Member
Thanks Michel for suggestions,

I was not getting how i can return value from sqlplus into unix variable but cookiemonster has resolved.

Many thanks.
Previous Topic: Cron Job monitoring
Next Topic: How to install Oracle 10g on RHEL 4?(c the error msg, plz!)
Goto Forum:
  


Current Time: Sun Jan 26 05:36:21 CST 2020