[ic] Not able to retrieve fields from custom table

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


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of Paul Jordan
> Sent: Thursday, May 13, 2004 10:19 AM
> To: interchange-users at icdevgroup.org
> Subject: RE: [ic] Not able to retrieve fields from custom table
> 
> 
> Tim Good [tim.g at edsd.com] wrote:
> >> Tim, it seems like your saying that [sql-param charge] is 
> not coming 
> >> through for you. Your email does not show the [query] that 
> is making 
> >> [sql-param charge] availiable. Please include that. Maybe 
> you forgot 
> >> to include "charge" in the select statement.
> >>
> >> Also, it may be easier, and cleaner to do somehting like:
> >>
> >> 		$Scratch->{charge_1} = 0;
> >> 		$Scratch->{charge_2} = 0;
> >> 		$Scratch->{charge_3} = 0;
> >>
> >>       $tmp = 0;
> >>        # If subtotal value exists, format it for totaling.
> >>        if ($subtotal && !($subtotal =~ /^\$/)) {
> >>           $tmp += $subtotal;
> >> 		$Scratch->{charge_1} = $tmp;
> >>        }
> >>        elsif ($subtotal && ($subtotal =~ /^\$/)) {
> >>           $tmp += substr($subtotal, 1, length($subtotal)-1);
> >> 		$Scratch->{charge_1} = $tmp;
> >>        }
> >>
> >>
> >>        # If install value exists, format it for totaling.
> >>        if ($install && !($install =~ /^\$/)) {
> >>           $tmp += $install;
> >> 		$Scratch->{charge_2} = $tmp;
> >>        }
> >>        elsif ($install && ($install =~ /^\$/)) {
> >>           $tmp += substr($install, 1, length($install)-1);
> >> 		$Scratch->{charge_2} = $tmp;
> >>        }
> >>
> >> Then disperse [scratchd charge_N] accordingly. You would 
> only have to 
> >> call your tag once.
> >
> > Paul,
> >
> > What I am saying, about [sql-param foo] and the [query] tag 
> is this; 
> > it works great except that when no results are returned the area 
> > between [query ...] [no_match]*****BLANK****[/no_match] [/query] is 
> > blank. I have tried to use the [query ...] tag and within 
> the body of
> 
> 
> I did not see any [no-match] tags. At any rate, for them to 
> work, you must use [list][/list] inside your query.
> 
http://www.icdevgroup.org/doc-5.0/frames/ictags_91.html

Paul


Paul,

As I said in my last post ...

>Ofcourse the code above is not the exact code which I was using for the
>[query ...] tag
>encaspulating <td>s and <tr>s. I included the code above as an example
>to where I was 
>working within the order_view page. 

However I negleted to see that the [list][/list] tags are required for 
[no_match][/no_match] to work. At a second glance at the documentation
I still don't see where it states that [list][/list] tags are requird 
inorder for the [on_match][/on_match] tags to work so thanks for 
pointing that out.

Some of the examples in the documentation for the [query ] tag imply
that
the [list][/list] are not required for [on_match][/on_match] to work:

Tag usage example:

This will list sku, description and price for ten products per page, 
followed by hyperlinks to the other pages of the list. 
Note that you may interpolate Interchange tags in the usual way 
if you double-quote the SQL statement.

    [query sql="select sku, description, price from products where price
< [value mv_arg]"
         type=list
         more=1
           ml=10]

      [on_match]Matched<br>[/on_match]
      [no_match]Not Found<br>[/no_match]

      [list]
        [sql-code] [sql-param description] [sql-price]
      [/list]

      [more_list]
        Matches [matches] of [match-count] shown.<BR>
        [more]
      [/more_list]
    [/query]

Maybe a short blurb on this fact would be helpful?

Thanks,
Tim




More information about the interchange-users mailing list