|
|
sybperl-l Archive
Up Prev Next
From: tcammell at dataaction dot com dot au
Subject: Re: Updating only certain records in a query...
Date: Oct 27 1999 4:46AM
Sounds like it'd be easy to do with a stored procedure and a cursor ... but
maybe you didn't want to hear that ;-)
TC
"Robert Banniza" on 27/10/99 14:08:07
Please respond to SYBPERL-L@listproc.net
To: SybPerl Discussion List
cc: (bcc: Terence Cammell/Data Action)
Subject: Updating only certain records in a query...
Guys,
I'm trying to write some Sybperl using CTlib that uses $ref =
$d->ct_sql("select id, comment_type from my_table", \&my_routine );
As I grab each row of data, I'm using an if statement as a conditional to
check whether to update that particular comment_type in that record. How
would I go about doing this?? This query is more of a table scan to check
for null values in comment_type. If comment_type eq null, I want to insert
a
value in comment_type. Could someone show me how to do this? I have tried
many different ways but still haven't figured out the right solution.
Thanks,
Robert
P.S. I have also looked at the solutions in /sybperl*/eg/ and couldn't find
anything.
---------------------------------------------------------------------
----------
Terence Cammell
Data Action Pty Ltd.
Phone: +61 (08) 8201 1099
Fax: +61 (08) 8373 2410
Email: tcammell@dataaction.com.au
|