merge into using perl from array

From: Barbara Baker <>
Date: Tue, 18 Aug 2009 14:58:37 -0600
Message-ID: <>

Does anyone have an example that uses the "merge into" syntax where the source would be an array in perl instead of a "real" table? Is it possible? Oracle Sun O/S 9 perl 5.8.5

Here's sorta what I'm trying to do:

merge into
  ffcst.user_auth tgt
  ad_mart.sales_dim_at_prod_reader src
on (src.sales_sid=tgt.sales_sid)
when matched then
  update set tgt.sales_rep_code = src.sales_rep_code when not matched
  insert (tgt.rep_first_name)
values ( src.rep_first_name)

I'm getting the max timestamp
$sth = $dbh->prepare( "

        SELECT  max(import_stamp) FROM plate_rpt
        " );

  unless ( $sth->execute() ) {
    $ResultMsg = "Select Max Timestamp from $db plate_rpt table failed";

  _at_row = $sth->fetchrow();

Then I'm

     selecting records from plate_counts
     where to_char(stamp, 'YYYY-MM-DD HH24:MI:SS') > '$last_ts'

and now I want to merge/insert the records I've found, but they're in memory.

Thanks for any ideas. Let me know if I'm crazy. (well, ok, that ship has sailed)


Received on Tue Aug 18 2009 - 15:58:37 CDT

Original text of this message