Using to_dsinterval or INTERVAL with placeholder



This may be less a DBI question and more Oracle - probably both...

Using DBD::Oracle

Given this table:

TABLE batch_application_sla
Name Null? Type

----------------------------------------- --------
----------------------------
ASSOCIATION VARCHAR2(100)

SLA INTERVAL DAY(2) TO
SECOND(6)
DISPLAY CHAR(1)

SUMMARY_DISPLAY CHAR(1)

LOAD_STATUS VARCHAR2(20)

PROCESS_DATE DATE

DESCRIPTION VARCHAR2(300)

SLA_DISP CHAR(1)

SLA_ADD_DAYS NUMBER


I can insert a row as follows:

insert into batch_application_sla
values('YYY',interval '23:32' HOUR to
MINUTE,'y','y','COMPLETE',to_date('2008/01/01',
'YYYY/MM/DD'),'TEST','y',0)

How can I use placeholders? I'm getting various errors with the
INTERVAL. This is one version:

INSERT into batch_application_sla
values(?,to_dsinterval(?,'HH:MI' HOUR to MINUTE),?,?,?,to_date(?,
'YYYY/MM/DD'),?,?,?)

The source data I'm loading is in "HH:MI" format, but I can transform it
into anything.

I've also tried:

INSERT into batch_application_sla
values(?,INTERVAL ? HOUR to MINUTE,?,?,?,to_date(?, 'YYYY/MM/DD'),?,?,?)

Many thanks,
Mike
.



Relevant Pages

  • Re: NOT IN/Nulls/ NOT EXISTS
    ... The answer will depend in part on the Oracle version. ... typically find that Oracle is able to transform the SQL statement into ... Predicate Information: ... NOT IN syntax. ...
    (comp.databases.oracle.misc)
  • Re: NOT IN/Nulls/ NOT EXISTS
    ... The answer will depend in part on the Oracle version. ... typically find that Oracle is able to transform the SQL statement into ... NOT IN syntax. ...
    (comp.databases.oracle.misc)
  • Re: Date Formats
    ... tables of SQL Server. ... I had problem in exporting these fields into Oracle. ... > I presume that the problem is that Oracle doesn't interpret the datetime values from SQL server ... > a format, hence trying to enforce a format for that datatype is meaningless. ...
    (microsoft.public.sqlserver.programming)
  • Re: No one could logon to productio database for a while
    ... Puget Sound Oracle Users Group ... code for script is quite simple, it does a v$sql to find all sql ... The script ask for the hash value of the SQL statement. ... col "SLAVE SQL" format A95 WORD_WRAP ...
    (comp.databases.oracle.server)
  • RE: timestamp datatype
    ... You must tell Oracle what format your DATE or TIMESTAMP data is in, ... rather than the raw Oracle DATE or TIMESTAMP format. ...
    (perl.dbi.users)