> -----Original Message-----
> From: Gerald Richter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 17, 2001 2:59 PM
> To: Jack Knight
> Cc: Embeded PERL ML
> Subject: Re: $fields versus !fields
>
>
> >
> > From:
> http://perl.apache.org/embperl/Recordset.pod.2.html#Search_parameters
> >
> > $fields
> > Fields which should be returned by a query. If you have
> specified multiple
> > tables the fieldnames should be unique. If the names are not unique you
> must
> > specify them along with the tablename (e.g. tab1.field).
> > NOTE 1: If !fields is supplied at setup time, this can not be overridden
> by
> > $fields.
> >
>
> $fields for Search or !Fields in Setup and Search, but not !fields. (The
> lowercase !fields above is a typo, that is already corrected in my
> developement version)
>
> >
> > So why does the 1 record not get displayed with the following code?
> >
> > <td align=center>[+ $BatchData[$row]{Batchnum} +]</td>
> > <td align=center>[+ $BatchData[$row]{Batchdate} +]</td>
> > <td align=center><input type=checkbox name=[+
> $BatchData[$row]{Id}
> +]
> > value="Y"></td>
> > </tr>
> >
>
> Because Id is undefined and this will end the Embperl dynamic table and
> prevent Embperl from fetching the remaining records. Try
>
> [$while ($rec = $BatchData[$row] $]
> <tr>
> <td align=center>[+ $rec -> {Batchnum} +]</td>
> <td align=center>[+ $rec -> {Batchdate} +]</td>
> <td align=center><input type=checkbox name=[+ $rec -> {Id} +]
> value="Y"></td>
> </tr>
> [$endwhile$]
Thanks - I spotted it myself (finally) about 2 minutes before your reply
came in. The original query did a select * rather than just the 2 fields I
was interested in, which is why it worked then.
> Gerald
>
> P.S. Unless you tell DBIx::Recordset to don't do it, it will convert all
> field names to lowercase, so you must write {batchnum} etc.
Already had grief with that one, now using $DBIx::Recordset::PreserveCase=1;
Thanks again.
Jack
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]