Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello all,
I have problems with my shell. I need to get “out” parameter from oracle stored procedure into shell display it. Please, tell me what I’m doing wrong?
Here is my shell:#!/bin/ksh
COUNT
sqlplus -s user/pwd <<END
exec EVENT_VERIFY_ALL;
exec EVENT_PRC_ALL($COUNT);
exit;
ENDecho "$COUNT records inserted"
exit 0Here is my procedure:
PROCEDURE EVENT_PRC_ALL(P_COUNT OUT NUMBER)
ISCURSOR MY_CUR
IS
SELECT COLUMN1
FROM Z_TABLE;BEGIN
FOR MY_REC IN MY_CUR
LOOP
Insert into X_TABLE(COLUMN1)
VALUES(MY_REC.COLUMN1);
END LOOP;p_count:=SQL%ROWCOUNT;
commit;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK ;END EVENT_PRC_ALL;
Any help appreciated!
OraDev

create or replace procedure p_1
as
begin
dbms_output.put_line('123');
end;
/#!/bin/ksh
RETURN_VALUE=`sqlplus -s <username>/<password> <<EOF
set feedback off
set serveroutput on
exec p_1;
EOF`echo "$RETURN_VALUE records inserted"
Luke Chi

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |