> Hi,
> 
> I'm trying to capture output from a table description query, input it into
> an array and use each line of that array as part of a CREATE statement.
> I'm
> trying to use fetchrow_arrayref() but I'm not sure I'm using it correctly
> or
> if its what I should be using. This code won't work because it captures
> the literal reference. How do I get it to output the actual line it
> references. The $i refers to a table name captured earlier from an array
> of table names. Any pointers welcome.     
> 
> while ( $array_ref = $sth->fetchrow_arrayref ) {
>         push @stash, [@$array_ref];
>       }
> 
>       foreach $array_ref (@stash){
>         $sql2 = "CREATE TABLE $i($array_ref)";
>         $sth2 = $dbh2->prepare($sql2);
>         $sth2->execute or die "Can't execute SQL statement: ",
> $sth2->errstr(), "\n";
>       }
> 
This is one example what it is trying to capture:

'cityname' 'string'
'x' 'int'
'y' 'int'

> Thanks
> 
> Shane
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to