Home » Developer & Programmer » JDeveloper, Java & XML » REGARDING USE OF PL/SQL BLOCK within SHELL SCRIPT
REGARDING USE OF PL/SQL BLOCK within SHELL SCRIPT [message #211232] Wed, 27 December 2006 07:42
Rony123
Messages: 14
Registered: December 2006
Junior Member
Hi All,

I m new to shell scripting nd PL/SQL. Im writing a shellscript that in which there is a pair of shell array variables whose values are present. Now I have to update a table column whose one row have same values as that of one shell array variable.
And i have to replace it with values of other shell array variable.

now i dont want to create database connection and release within while loop.So i have written the following
PL/SQL block within the shell script.

But the problem is after running the script..
output appears as PL/SQL procedure successfully completed.

But the datbase is not updated.That i want

code Snippet:
sqlplus -S $DBUSER/$DBPASS <<- !

DECLARE
j INTEGER :=3;
i INTEGER :=${count};
BEGIN
WHILE j < i LOOP
update testhil1 set ID='${val_a[$j]}' WHERE id='${val_b[$j]}'
END LOOP;
END;
.
/
commit;
quit;
!

IN ANY OTHER WAY I CAN DO IT
IF NOT POSSIBLE THROUGH THIS WAY.

Thanks in advanc
HAPPY NEW YEAR
Previous Topic: calling a java class from a shell script
Next Topic: pagepanel visual editor activation
Goto Forum:
  


Current Time: Sun Nov 24 13:51:39 CST 2024