Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Passing an Array of Attributes to SQL

by cocl04 (Sexton)
on Oct 07, 2009 at 14:34 UTC ( [id://799731]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Passing an Array of Attributes to SQL
in thread Passing an Array of Attributes to SQL

Yes. The array reference returns the two case statements. I did

use Data::Dumper;print Dumper($case);

and it returns the two case statements.

I also printed it and it returns the same thing. I am passing a case statement as an attribute / object and when I passed one to the sql statement perl sends it to sqlplus as a normal part of the query. And it works. I just want to be able to send all of them as one string to the query.

Replies are listed 'Best First'.
Re^5: Passing an Array of Attributes to SQL
by mje (Curate) on Oct 07, 2009 at 14:49 UTC

    Assuming fetchrow_arrayref is returning multiple rows but each row has one column which is your case SQL beginning with a comma already then why can't you just do:

    my $case = $case_query1->fetchall_arrayref(); my $casestr = join(q{}, @{$case}); . . . my $case_stmt3 = "create table case_st_data1 as (S +ELECT rd, store_number $casestr FROM test_ptw_bottom_10 where week_end_date in ('19-SEP-09','26-sep-09') group by rd, store_number)";

      I appreciate your help. I was able to get it to work! Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://799731]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found