
vladinator
Novice
Dec 14, 2006, 3:36 PM
Post #1 of 2
(5491 views)
|
insert in perl function inside cgi module
|
Can't Post
|
|
inside Cgi Module I have this perl function: sub insert_DB() { my $dbh1=shift; my @buffer=@_; #select values from the external table my $st = $dbh1->prepare ( qq ( select to_char(sysdate, 'yyyymmdd-HH24MISS') from dual )); $st->execute(); my $sys_date = $st->fetchrow(); #print "<br>$sys_date<br><br>"; my $st = $dbh1->prepare( qq ( insert into zBOT_Configuration (config_group_id,config_var_id,config_name,config_value) values (2,3,1,1); commit; )); $st->execute(); for (my $i = 1; $i <=7; $i++) { my @pairs = split(/=/, $buf[$i]); #print "$pairs[0]<br>"; #print "$pairs[1]<br>"; } #print "<br><br><br>"; my $st = $dbh1->prepare ( qq ( select * from zBOT_Configuration )); $st->execute(); my @configs = (); while (my @rows = $st->fetchrow_array()) { push (@configs,@rows); } foreach my $z(@configs) { #print "$z<br>"; } } Now all the selects work fine, but the insert doesnt, when i copy and paste the insert inside sqlplus it works fine Also I have used insert here before and it worked fine. Now for some odd reason it wont work plz help.
|