Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    1

    Unhappy Unanswered: Binding array to placeholder (Pg)

    How can I insert an array into a Postgres table?

    If I have a table xyz which has a column dates of the type 'timestamp without time zone[]', how can I insert a value into that table?

    It DOESN'T work like this:
    Code:
    my @times = ('2005-09-27 08:46:00', '2005-09-27 08:48:00');
    
    my $sth = prepare("INSERT INTO test.xyz (dates) VALUES (?)");
    $sth->execute(\@times);

  2. #2
    Join Date
    Jun 2004
    Location
    Nowhere Near You
    Posts
    89
    Code:
    my $time;
    foreach $time (@time) {
      $sth->execute($times);
       };

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •