|
||||
sybperl-l ArchiveUp Prev Next
From: Michael Peppler <mpeppler at mbay dot net> Perumal, Saravana writes:
> $dbh = Sybase::CTlib->ct_connect('user','pass','serv','db');
> $stt = "declare \@edate char(30)";
> $stt .= " SELECT \@edate = convert( char(30), getdate(), 109) ";
> print $stt;
>
> $dbh->ct_execute("$stt");
>
> while (( $rc = $dbh->ct_results($restype)) == CS_SUCCEED)
> {
> next if ( $restype == CS_CMD_FAIL || $restype == CS_CMD_SUCCEED
> || $restype == CS_CMD_DONE);
>
> while (%dat = $dbh->ct_fetch(1))
> {
> print "Test";
> print "Value --> $dat{edate}\n";
You are expecting a column called edate.
In this case you aren't getting it - actually you're not getting
anything at all, because
select @edate = ...
will not return any results - it just assigns the appropriate date to
the @edate variable.
You need to execute something like
select 'edate' = convert(char, getdate(), 109)
and things should work a lot better.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
|