PDA

View Full Version : DBI to ASP


tj1
03-27-02, 10:41
This isn't really a DBI issue, more like a PerlScript/ASP issue, but I thought this might be the best place to pose th equestion.

I am converting several data base modules from Perl CGI to PerlScript and have run into the following problem. When I execute an SQL command to update or delete records from a table, I want to know how many records (if any) were affected. According to the ASP documentation dealing with the Execute method for the connection object, the following should do the trick:


$do_sql = $db->Execute($sql_cmd, $recs_affected);


However, while the statement executes fine (as always), the variable $recs_affected never contains a value. I have tried changing the statement to the following:


$do_sql = $db->Execute($sql_cmd, \$recs_affected);


thinking that maybe an address was needed insted. According to the ASP

documentation Execute is looking for a "long value" as this parameter. The following code works fine under VBScript:


do_sql = db.Execute(sql_cmd, recs_affected)



I was just wondering if anyone has run across this problem, and if there is a solution.


Thanks,

TJ

ivorw
04-09-02, 11:46
$db->execute returns the number of rows processed for all operations other than SELECT.

See http://perldoc.com/perl5.6.1/lib/DBI.html#execute

cjaykumar
02-18-04, 17:19
Hello,

You look like an expert on ASP/PerlScript..I am just getting into it and I was looking for a way to connect to an oracle database using ODBC or OO4O.

How do I pass the tnsname, username and password to get connected to an oracle db?

Your help will me much appreciated.