Up Prev Next
From: Rob Fenstermacher <fence at bwn dot net>
Subject: RE: Updating only certain records in a query...
Date: Oct 27 1999 4:49AM
maybe I'm not understanding the question, but how about something like
$ref = $d->ct_sql("select id from my_table where comment_type is null",\&my_routine);
then update each row separately...
$d->ct_execute("update my_table set comment_type='hi mom' where comment_type is null");
if you want to set them all the same....
but, it is more likely that I am misunderstanding your question.
Have a good one
Conversion Specialists, Inc
From: Robert Banniza[SMTP:email@example.com]
Reply To: SYBPERL-L@listproc.net
Sent: Tuesday, October 26, 1999 10:38 PM
To: SybPerl Discussion List
Subject: Updating only certain records in a query...
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.
P.S. I have also looked at the solutions in /sybperl*/eg/ and couldn't find