# ORACLE STORED PROCEDURE # CREATE OR REPLACE PACKAGE selectall AS TYPE my_cursor IS REF CURSOR; PROCEDURE CATEGORYLIST1(CAT_CURSOR OUT my_cursor); END selectall; / CREATE OR REPLACE PACKAGE BODY selectall AS PROCEDURE CATEGORYLIST1(CAT_CURSOR OUT my_cursor) IS BEGIN OPEN CAT_CURSOR FOR SELECT KP_CH_CATEGORY_NAME FROM KP_CH_CATEGORY ORDER BY KP_CH_CATEGORY_NAME; CLOSE CAT_CURSOR; END CATEGORYLIST1; END selectall; / # Perl code # #!/usr/bin/perl -w BEGIN { $|=1; open(STDERR,">&STDOUT"); print("content-type:text/html\n\n"); } use CGI qw/:all/; use DBI; use DBD::Oracle qw(:ora_types); $ENV{ORACLE_HOME}="/u01/app/oracle/product/8.1.7"; my $dbh = DBI -> connect('dbi:Oracle:host="192.168.7.80";sid="ktpn";port=1521"', 'cwl', 'cwl', { RaiseError => 1, AutoCommit => 1 } ) || die "Error while connecting to database : $! \n"; my $sth = $dbh->prepare(q{BEGIN:selectall.CATEGORYLIST1(:p_my_cursor); END;}); my $my_cursor; print "Executed upto this point"."\n"; $sth->bind_param_inout(":p_my_cursor", \$my_cursor, 0, { ora_type => ORA_RSET }); $sth->execute; $sth->finish; my @row; while( @row = $my_cursor->fetchrow_array) { foreach $_ (@row) { print $_; print "\n"; } } $my_cursor->finish; $dbh->disconnect; # ERROR # Executed upto this point DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute) at /var/www/html/narayan/cgi-bin/Try.cgi line 19. DBD::Oracle::st execute failed: ORA-01008: not all variables bound (DBD ERROR: OCIStmtExecute) at /var/www/html/narayan/cgi-bin/Try.cgi line 19.