[ic] Delete SQL within query tag returns ??

Tim Good tim.g at edsd.com
Thu May 13 11:12:45 EDT 2004


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of Tim Good
> Sent: Thursday, May 13, 2004 8:56 AM
> To: interchange-users at icdevgroup.org
> Subject: [ic] Delete SQL within query tag returns ??
> 
> 
> Hello list,
> 
> I am working on developing a Usertag to remove an item
> from an existing order. The tag will then update the 
> totals for the order. My question is when using delete
> sql within the query tag what is returned?
> 
> My usertag would look something like ... (depending on what is
> returned):
> 
> UserTag delitem Order curo
> UserTag delitem PosNumber 2
> UserTag delitem addAttr
> UserTag delitem Routine <<EOR
> sub {
>         my ($curo,$delitem) = @_;
>     
>         my ($sql, $results, $itemprice, $iteminstall, $totcst);
> 
>         $sql = "delete from orderline where order_number = 
> $curo and sku = $delitem";
>         $results = $Tag->query({ table=>'orderline', sql=>$sql });
>                 .
>                 .
>                error checking
>                 .
>                 .
>          
>         $itemsub = $results->[0]->[10];
>         $iteminstall = $results->[0]->[24];
>         $totcst -= $itemsub + iteminstall;
>         $sql = "update tranactions set total_cost = $totcst 
> where order_number = $curo";
>         $results = $Tag->query({ table=>'transactions', sql=>$sql });
> 
>                 .
>                 .
>                error checking
>                 .
>                 .
> 
>         return ... error or no error ...;
> }
> EOR
> 
> (mysql 3.23.58 on Redhat 8.0 non threaded perl 5.8.2 interchange 5.2
> stable)
> 
> All help is greatly appreciated,
> 
> Tim
> 
Ok answered my own question ?? I think. From Mysql.org's website:

DELETE deletes rows from tbl_name that satisfy the condition given by
where_definition, 
and returns the number of records deleted. 

would this mean that $results would hold the # of rows deleted when set
on left side
of $Tag->query?

Thanks,

Tim




More information about the interchange-users mailing list