Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: passing java 'Date' array in to SP

    I am trying to pass an array of 'dates' in to an oracle stored procedure.

    I have tried creating a timestamp_nt ( of timestamps)

    passed in to the procedure as : p_time IN timestamp_nt

    however when you itterate over this in a loop and call

    v_time timestamp;
    v_time := p_time.first;

    I get pls-00382: expression of wrong type.


    I have also tried with Dates, and get the same error.

    are there any ways to do this? possibly passing in a long_type_nt then converting back to timestamp ?

    thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171
    can u post the code of your java routine and your SP?
    Oracle can do wonders !

  3. #3
    Join Date
    Feb 2004
    Posts
    5
    here is the sql I am trying to run, it throws the error on compiling, even before I try and call it from java


    PROCEDURE pr_update( p_number1 IN int_nt,
    p_number2 IN int_nt,
    p_time IN timestamp_nt)
    AS

    v_number1 number(10);
    v_number2 number(10);
    v_time timestamp;

    BEGIN
    v_number1 := p_number1.first;
    v_number2 := p_number2.first;
    v_time := p_time.first; ******error here******

    loop
    exit when v_number is null;
    v_number1 := p_number1.next( v_number1 );
    v_number2 := p_number2.next( v_number2 );
    v_time := p_time.next( v_time ); ******error here******

    update table_a
    set table_a.column1 = v_number2, table_a.column2 = v_time
    where table_a.column3 = v_number1;

    end loop;

    END pr_update;

  4. #4
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171
    how are int_nt and timestamp_nt declared as?can u also post the code of these definations?
    Oracle can do wonders !

  5. #5
    Join Date
    Feb 2004
    Posts
    5
    Originally posted by cmasharma
    how are int_nt and timestamp_nt declared as?can u also post the code of these definations?
    sorry, they are:

    create type int_nt is table of number(10);

    create type timestamp_nt is table of timestamp;

Posting Permissions

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