OTECTED]>
Sent: Wednesday, October 16, 2002 9:41 PM
Subject: Re: creating a string on the fly
> Here's the code:
>
> sub GetColumns{
> my @columns="";
> $statement=uc("SELECT colname from
> syscat.columns where tabname='$_[0]&
{
> $table = shift;
>
> print "CREATE VIEW_$table AS\n";
> print "SELECT (";
>
> $n = 0;
> foreach $column ( GetColumns ($table) )
> {
> print ", " if $n++;
> print
[EMAIL PROTECTED]>
> To: "Rob" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 15, 2002 11:05 PM
> Subject: RE: creating a string on the fly
>
>
> > Rob,
> >
> > I've written a subroutine do the
> getColu
AIL PROTECTED]>
Sent: Tuesday, October 15, 2002 11:05 PM
Subject: RE: creating a string on the fly
> Rob,
>
> I've written a subroutine do the getColumns($table). The problem is that
> it's passing the entire column set back and appending each one.
>
'Passing the
.any ideas?
-Original Message-
From: Rob [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 11:38 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: creating a string on the fly
Two problems here.
1/ Getting the tables' names and columns from the database.
2/ Constructi
On Oct 15, Rob said:
>Suppose we needed to throw out all 'system' column names (such as the
>internal table ID or the creation date) which, say, started with an
>underscore. We would want to put
>
>next if $column =~ /^_/;
>
>at the start of the loop - a loop which wouldn't exist if we'd
Or, of course:
$, = ", ";
print GetColumns ($table);
R
- Original Message -
From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
To: "Rob" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday
ROTECTED]>
To: "Rob" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 5:55 PM
Subject: Re: creating a string on the fly
> On Oct 15, Rob said:
>
> > $n = 0;
> >foreach $column ( GetColumns ($table) )
On Oct 15, Rob said:
>$n = 0;
>foreach $column ( GetColumns ($table) )
>{
>print ", " if $n++;
>print $column;
>}
That's spelled
print join ",", GetColumns($table);
in Perl. :)
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http:/
-- Original Message -----
>From: "Vincent Lee" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Tuesday, October 15, 2002 3:37 PM
>Subject: Re: creating a string on the fly
>
>
>> I'm starting with data in the da
any more
about what these might do without knowing more about what interface you have
with the database.
HTH
Rob
- Original Message -
From: "Vincent Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 15, 2002 3:37
>Bring the answer back to the mail group so that others can learn.
>
>Cheers,
>
>Rob
>
>- Original Message -
>From: "Vincent Lee" <[EMAIL PROTECTED]>
>To: "Rob" <[EMAIL PROTECTED]>
>Sent: Tuesday, October 15, 2002 3:03 PM
>Subject:
Hi Vincent
I /think/ you're misunderstanding hashes, but I need to make sure.
Do you mean that your has array contains:
ORG => ID
ORG => COL1
ORG => COL2
EMPLOYEE => ID
EMPLOYEE => COL1
EMPLOYEE => COL2
Because you can't do that.
A hash represents a one-
13 matches
Mail list logo