[Templates] Re: Returning a select using multiple tables

[prev] [thread] [next] [Date index for 2004/10/25]

From: Robert
Subject: [Templates] Re: Returning a select using multiple tables
Date: 14:26 on 25 Oct 2004
"Dave Cross" <dave@xxxx.xxx.xx> wrote in message
news:20041025141046.GK10493@xxxxxxx.xxx...
> On Mon, Oct 25, 2004 at 09:42:04AM -0400, Robert wrote:
> > My select statments looks like this (from ORACLE):
> >
> > SELECT surname, first_name, msf810.email_address, msf810.employee_id
> >
> > When I plug this into a loop it looks like this:
> >
> >             <td>[% user.SURNAME %]</td>
> >             <td>[% user.FIRST_NAME %]</td>
> >             <td>[% user.MSF810.EMAIL_ADDRESS %]</td>
> >             <td>[% user.MSF810.EMPLOYEE_ID %]</td>
> >
> > TT2 apparently does not like it when there are multiple periods. So
> > how do I get around this? In a "normal" Perl script I would just do a
> > "bind_columns" but I do not know where to insert that, if I even can.
> > I am searching via Google but nothing so far.
>
> One suggestion would be to rewrite your SQL to give your columns aliases
> which don't contain dots.
>
> SELECT surname, first_name, msf810.email_address as email_address,
>        msf810.employee_id as employee id
>
> and then...
>
>              <td>[% user.SURNAME %]</td>
>              <td>[% user.FIRST_NAME %]</td>
>              <td>[% user.EMAIL_ADDRESS %]</td>
>              <td>[% user.EMPLOYEE_ID %]</td>
>
> (all this untested as I don't have an oracle installation to hand)
>
> Dave...
>
> -- 
>   We are far too young and clever

Thanks! I had actually tried that but since I messed up the loop construct.

I am very impressed with TT.  :-)

Robert




_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Re: Returning a select using multiple tables
Robert 14:26 on 25 Oct 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52