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

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)";

Replies are listed 'Best First'.
Re^6: Passing an Array of Attributes to SQL
by cocl04 (Sexton) on Oct 07, 2009 at 15:13 UTC

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