CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
insert in perl function inside cgi module

 



vladinator
Novice

Dec 14, 2006, 3:36 PM

Post #1 of 2 (2995 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.


vladinator
Novice

Dec 14, 2006, 6:54 PM

Post #2 of 2 (2993 views)
Re: [vladinator] insert in perl function inside cgi module [In reply to] Can't Post

i found the problem

it was ;

in the insert statement weird stuff!~

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives