Oracle SQL parallel query within PERL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbrizu2
    New Member
    • Apr 2010
    • 1

    #1

    Oracle SQL parallel query within PERL

    Hello - I am trying to run an oracle parallel query within a perl script but it will not work. I am getting the following error: ORA-24373: invalid length specified for statement (DBD ERROR: OCIStmtPrepare)
    I would appreciate any sugguestions on what to try in order to get this to work.

    Code:
    sub cre_mob_arch_tmp {
      print "  (*) Creating Base of Mobility Trouble_Ticket_Archive Tickets ...\n";
      $sql_statement = `
         Create table mob_arch_tmp as select /*+ PARALLEL(a 8) */ * from trouble_ticket_archive@mobility a where to_char((TO_DATE('1970-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')+NUMTODSINTERVAL("CLOSED_TIME"-14400,'second')), 'DD-MON-YY') = to_char(sysdate-1, 'DD-MON-YY')
    /
      `;
    
      unless ($rows = $dbh->do("$sql_statement")) {
        &programError("Could not create table MOB_ARCH_TMP", "$sql_statement", "$DBI::errstr", "dba", "jbriz");
        $dbh->rollback;
        &logoffOracle($dbh);
        exit;
      }
    } # sub cre_mob_arch_tmp
    Last edited by numberwhun; Apr 3 '10, 01:50 PM. Reason: Please use CODE TAGS!!!
Working...