John,
Why did you comment out
#my $sth = $dbh->prepare(qq{select sysdate from dual});
This is what you want to use, and in fact gives me the date very nicely.
The "select sysdate into :mydate from dual" isn't going to do anything
useful.
If you insist on getting the data into $mydate, just select it into
$mydate, rather than into $row. Note that this gives you a _string_, not a
Perl date. So you'll want to set NLS_DATE_FORMAT to something easy to
parse. See your Oracle documentation for this.
Tom Wyant
John Deretich <[EMAIL PROTECTED]>@listserv.ActiveState.com on
02/21/2003 04:31:00 PM
Sent by: [EMAIL PROTECTED]
To: "'?d Derek Douglas-Hecker'" <[EMAIL PROTECTED]>,
"Perl-Win32-Admin-Request \(E-mail\)"
<[EMAIL PROTECTED]>
cc:
Subject: RE: sql statements
I am trying to use dbi
to pull the system date and
put into it into a scalar.
I tried initializing the mydate variable
in sql to perl as $mydate = undef;
but it returned the message can't bind
unknown placeholder ':p1'.
Any ideas.
thanks,
John
-----Original Message-----
From: ?d Derek Douglas-Hecker [mailto:[EMAIL PROTECTED]
Sent: Friday, February 21, 2003 1:25 PM
To: John Deretich
Subject: RE: sql statements
below works for me....actually both statements return the same value...what
are you trying to do?
?d
use DBI;
$dbh = DBI->connect("dbi:Oracle:",'username','password') or die
"$DBI::errstr\n";
my $sth = $dbh->prepare(qq{select sysdate into :mydate from dual});
#my $sth = $dbh->prepare(qq{select sysdate from dual});
if (! ($sth->execute())) {
print "$DBI::errstr\n";
}else{
$row = $sth->fetchrow_array;
print "$row\n";
}
$sth->finish;
$dbh->disconnect;
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender
by return e-mail and delete this e-mail from your system. Unless
explicitly and conspicuously designated as "E-Contract Intended",
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer. This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs