Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: DBD::ANYDATA create table help please.

by jeremyh (Beadle)
on Jan 28, 2004 at 00:25 UTC ( #324584=note: print w/ replies, xml ) Need Help??


in reply to DBD::ANYDATA create table

I agree with the posting about the table naming convention (these are in the DB, not on the OS). I think your approach will work if you change $ladder_table_fields so that it has the datatypes (not just the field names), i.e. my $ladder_table_fields = "player_name varchar2(30), id varchar2(9), position varchar2(30), ..."; # this would work in Oracle Also, change $sth->execute( $@sql_parameters ); to $sth->execute( $ladder_table, $ladder_table_fields[0], $ladder_table_fields1, ... I tested something like you had where you wanted to pass in the field names as a list (array), but I couldn't get $sth->execute to see it in a list context. Passing it as individual scalars worked. Of course you give up the reusability of $sql_command, but making it reusable might be more trouble than it's worth. Hope this helps, jeremyh


Comment on Re: DBD::ANYDATA create table help please.
Replies are listed 'Best First'.
Re: Re: DBD::ANYDATA create table help please.
by jeremyh (Beadle) on Jan 28, 2004 at 00:45 UTC
    Sorry for the formatting, I'll try posting as code (should have read further!) I think your approach will work if you change $ladder_table_fields so that it has the datatypes (not just the field names), i.e.  my $ladder_table_fields = "player_name varchar2(30), id varchar2(9), position varchar2(30)"; # etc., this would work in Oracle Also, change $sth->execute( $@sql_parameters ); to  $sth->execute( $ladder_table, $ladder_table_fields[0], $ladder_table_fields[1] # etc. I tested something like you had where you wanted to pass in the field names as a list (array), but I couldn't get $sth->execute to see it in a list context. Passing it as individual scalars worked.
      $sth->execute( $ladder_table, $ladder_table_fields[0], $ladder_table_fields[1],...

      You probably meant this instead... :-)
      $sth->execute( $ladder_table, @ladder_table_fields );

        Actually I couldn't get

        $sth->execute( $ladder_table, @ladder_table_fields );

        to work.

        I didn't think of join, like in your example.

        Does it (the array as a list) work on your installation?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-07-30 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls