PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Tom Wilson <73123 dot 1360 at compuserve dot com>
Subject: de-referencing pointers
Date: Mar 25 1996 3:49PM

Help!   I'm corn-fused!  I need to execute a SQL statement that returns only a
single value.  I use $ref=$handle->sql(...) to execute it.  But I can't seem to
access the returned value in a single statement.  I'm sure my syntax is screwed
up somewhere, but I can't figure it out.  Here's an example:

$ref=$dbh->sql("select getdate()");   # this returns a pointer to an array of
pointers
$ref2=$$ref[0]; # 		this returns a pointer to the first (and only)
row                                                          
$date=$$ref2[0];         # this returns the actual value

I'm trying to set the $date value without having to set the intermediate $ref2
value.
Shouldn't I be able to assign $date directly, e.g. $date=$${$$ref[0]}[0]?


Tom Wilson