> -----Original Message-----
> From: Isaac [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 05, 2001 3:06 PM
> To: [EMAIL PROTECTED]
> Subject: specifying types with bind columns
>
>
>
> Hi,
>
> I was hoping someone could give me the right syntax for specifying
> what type of data a column is with bind columns.  I get an error
> from perl.exe when trying to update some stuff on my Access Database
> and I think telling my script explicitly what kind of data it is
> (number or
> string will fix it)
>
> Code:  Where the ***** are is where I need the help.
>
> Thanks!
>
>
> $thismonth = $dbh->prepare( qq{Select CustomerID, CompanyName, ThisMonth
> from Customers});
>
>   print "Executing SQL Statement: " . $thismonth->{Statement} . "\n\n";
>
>   print $thismonth->execute() . "\n\n" or die "Could not execute SQL
> Statement:" .  $thismonth->errstr;
>
>   #Now Need to access the actual values
>   ***************  I need to have customerid be specified number,
> companyname as string and currentmonth as number *************
>   $thismonth->bind_columns(  \$customerid, \$companyname, \$currentmonth);
>
>   while( $thismonth->fetch() ) {
>
>   print "The Current month's bandwidth total for $companyname is:
> $currentmonth\n\n";
>
>   ##Now Need to UPdate Archives Table with $currentmonth placed
> into column
> of lastmonth######
>   $updatelast = $dbh->prepare (qq {update Archives set $abbrevdate =
> $currentmonth where Customerid = $customerid});

How about checking if this query will even work directly in access, which I
really doubt it will.

Access uses #data# to specify it's date, so you must change your query
accordingly.  Also you would not get an error from perl.exe if there was
something wrong with your query, but rather from the $DBI::errstr.

$updatelast = $dbh->prepare (qq {update Archives set $abbrevdate =
#$currentmonth# where Customerid = $customerid});

Not sure if this is all that is wrong, but worth a try.

Also "I am getting an error from perl.exe" is not very helpful to us.  A
complete error message would do magic.

Ilya



>
>   print "Executing SQL Statement: " .  $updatelast->{Statement} . "\n\n";
>
>   $updatelast->execute();
>
>   #End Of While Loop
>  }
>
>
>

Reply via email to