JDBC truncates plsql varchar2 variable to 4000

I have recently upgraded classes12.jar and ojdbc14.jar used in our app to 10gR2 versions. However all pl/sql VARCHAR2 variables >4000 characters retrieved via a package are now truncated to 400 characters.
I am using the database package to generate a query on the fly which I then pass back to the calling java for it to execute.
The VARCHAR2 variables are PL/SQL varaiables only - nothing is being written to the database (hence the 4000 character limit shouldn't apply)

Johnny98 wrote:
I'm trying to pass a JSON string into a stored procedure that has a single VARCHAR2 variable.Usually JSON is output from a stored proc (as part of generating dynamic web content or responding to Ajax calls). Strange to see it being passed as input.. and parsed?
The error you get is from the Save_JSON() procedure itself. The error stack (that you did not post), will include the call stack, unit code names, and source code line numbers. This will pinpoint just where the exception was raised.
I asked, "+parsed?+" - as that would explain the error. A bug in parsing text into structured data typically results in a "+ORA-06502: PL/SQL: numeric or value error+".
Also, the actual exception text you posted says:
ORA-20001: ORA-06502: PL/SQL: numeric or value error
And this points to yet another fubar exception handler implementation.
The exception handler very likely looks as follows:
exception when OTHERS then
  raise_application_error( -20001, SQLERRM(SQLCODE) );
end;Pardon my blunt response, but this is idiotic. Exception handlers should NOT change a meaningful exception (like -6502) into a generic catchall error (like -20001). NOT IN ANY LANGUAGE. NOT IN PL/SQL. This is not how robust and well designed software is engineered.

Similar Messages

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

  • How to see the datas stored in DBMS_SQL.Varchar2S variable?

    how to see the datas stored in DBMS_SQL.Varchar2S variable?
    it says error if i use dbms_out.put_line.

    in PLSQL :
    procedure p_try (p_test IN OUT DBMS_SQL.VARCHAR2S) is
    begin
        p_test.delete ;
        p_test(    -3000) := '===============' ;
        p_test(       22) := 'Hello'  ;
        p_test(    55555) := 'World' ;
        p_test(987654321) := '===============' ;
    end p_try;
    set serveroutput on
    declare
         l_test dbms_sql.varchar2s ;
         i number ;
    begin
         p_try (l_test) ;
         i :=  l_test.first ;
         while i >= l_test.first and i <= l_test.last loop
                 dbms_output.put_line (l_test(i)) ;
                 i := l_test.next(i) ;
         end loop ;
    end ;
    ===============
    Hello
    World
    ===============when using Forms, you would use TEXT_IO instead of DBMS_OUTPUT

  • What's the maximum size a varchar2  variable can hold for and NDS Stmnt?

    What's the maximum size a varchar2 variable can hold for and NDS Statement? I read that NDS is good for doing EXECUTE IMMEDIATE on statements that aren't too big. The 10g PL/SQL manual recommends using DBMS_SQL for statements that are too large, but it never gave a limit for what too large was. Does anyone know offhand?

    The limit is the same as the length of varchar2 variable within PL/SQL - that is varchar2(32767).It's not documented, but intermediate concatenation result can hold up to (64k-1) :
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    declare
      part1 varchar2(32767) := rpad('begin null;', 32767);
      part2 varchar2(32767) := lpad('end;',        32767);
    begin
      dbms_output.put_line(length(part1 || ' ' || /*' ' ||*/ part2));
      execute immediate part1 || ' ' || part2;
    end;
    65535
    PL/SQL procedure successfully completed.

  • Passing PL/SQL varchar2 variable to XML Query

    Hi guys,
    i'm having trouble passing a pl/sql varchar2 variable to an XMLQuery.
    This is the relevant part of my code:
    DECLARE
       lo_result   XMLTYPE;         --contains the XML which is being parsed below
       lo_return   XMLTYPE;             -- for the XML result returned by XMLQuery
       lo_start    VARCHAR2 (100) DEFAULT 'Toronto'; -- a PL/SQL varchar2 variable
       lo_end      VARCHAR2 (100) DEFAULT 'Ottawa';  -- a PL/SQL varchar2 variable
    BEGIN
       SELECT XMLQUERY (
                 'for $i in //leg[start_address[text()[contains(.,$lo_start)]] and end_address[text()[contains(.,$lo_end)]]]/distance/value/text() return ($i)'
                 PASSING lo_result, lo_start AS "lo_start", lo_end AS "lo_end"
                 RETURNING CONTENT)
         INTO lo_return
         FROM DUAL;
    END;The XPath expression is correct but it doesn't seem to accept my variables since lo_return is empty.
    I think the variables should be of type Xmltype but the compiler won't let me convert them because they do not contain any XML tags .
    Hope anyone can help.
    Thanks,
    Martina

    may be i missed anything but
    >
    <start_address>Toronto, Ontario, Kanada</start_address>
    <end_address>Huntsville, Alabama, Vereinigte Staaten</end_address>
    >
    and
    >
    lo_start VARCHAR2 (100) DEFAULT 'Toronto'; -- a PL/SQL varchar2 variable
    lo_end VARCHAR2 (100) DEFAULT 'Ottawa'; -- a PL/SQL varchar2 variable
    >
    so
    SQL> SELECT XMLQUERY (
      2              'for $i in //leg[start_address[text()[contains(.,$lo_start)]] and end_address[text()[contains(.,$lo_end)]]]/distance/value/text() return ($i)'
      3               PASSING
      4               xmltype('<DirectionsResponse>
      5    <status>OK</status>
      6    <route>
      7      <summary>I-75 N</summary>
      8      <leg>
      9        <duration>
    10          <value>48220</value>
    11          <text>13 Stunden, 24 Minuten</text>
    12        </duration>
    13        <distance>
    14          <value>1404935</value>
    15          <text>1.405 km</text>
    16        </distance>
    17        <start_location>
    18          <lat>43.6533100</lat>
    19          <lng>-79.3827700</lng>
    20        </start_location>
    21        <end_location>
    22          <lat>34.7303300</lat>
    23          <lng>-86.5860700</lng>
    24        </end_location>
    25        <start_address>Toronto, Ontario, Kanada</start_address>
    26        <end_address>Huntsville, Alabama, Vereinigte Staaten</end_address>
    27      </leg>
    28    </route>
    29  </DirectionsResponse>'),
    30               'Toronto' AS "lo_start", 'Ottawa' AS "lo_end"
    31               RETURNING CONTENT)
    32       FROM DUAL;
    XMLQUERY('FOR$IIN//LEG[START_A
    SQL>
    SQL>
    SQL>
    SQL> SELECT XMLQUERY (
      2              'for $i in //leg[start_address[text()[contains(.,$lo_start)]] and end_address[text()[contains(.,$lo_end)]]]/distance/value/text() return ($i)'
      3               PASSING
      4               xmltype('<DirectionsResponse>
      5    <status>OK</status>
      6    <route>
      7      <summary>I-75 N</summary>
      8      <leg>
      9        <duration>
    10          <value>48220</value>
    11          <text>13 Stunden, 24 Minuten</text>
    12        </duration>
    13        <distance>
    14          <value>1404935</value>
    15          <text>1.405 km</text>
    16        </distance>
    17        <start_location>
    18          <lat>43.6533100</lat>
    19          <lng>-79.3827700</lng>
    20        </start_location>
    21        <end_location>
    22          <lat>34.7303300</lat>
    23          <lng>-86.5860700</lng>
    24        </end_location>
    25        <start_address>Toronto, Ontario, Kanada</start_address>
    26        <end_address>Huntsville, Alabama, Vereinigte Staaten</end_address>
    27      </leg>
    28    </route>
    29  </DirectionsResponse>'),
    30               'Toronto' AS "lo_start", /*'Ottawa'*/'Huntsville' AS "lo_end"
    31               RETURNING CONTENT)
    32       FROM DUAL;
    XMLQUERY('FOR$IIN//LEG[START_A
    1404935
    SQL>

  • How can I make Function return varchar2 more than 4000

    I have a function
    FUNCTION testing (v_pk_application in number, v_inccharges in char)
    return varchar2(30000)
    --return number
    is
    v_net_sum varchar2(30000);
    v_net_sum2 varchar2(30000);
    v_datarow varchar2(3000);
    v_datarow2 varchar2(3000);
    begin
    return v_net_sum;
    end;
    I want to return varchar2 more than 4000, how can I do that.
    Thanks

    user10659388 wrote:
    I want to return varchar2 more than 4000, how can I do that.A function can return a string up to the maximum allowed for varchar2.
    Varchar2 can be up to 32767 characters...
    SQL> create or replace function ret_str return varchar2 is
      2    v_str varchar2(32767);
      3  begin
      4    v_str := lpad('*',32767,'*');
      5    return v_str;
      6  end;
      7  /
    Function created.
    SQL> declare
      2    v_retstr varchar2(32767);
      3  begin
      4    v_retstr := ret_str();
      5  end;
      6  /
    PL/SQL procedure successfully completed.However, SQL only supports varchar2 up to 4000 characters so the same function will cause SQL to error, even though the function is perfectly valid.
    SQL> select ret_str() from dual;
    select ret_str() from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SCOTT.RET_STR", line 5
    SQL>So, if you intend to use the function only in PL/SQL then you can use varchar2 up to 32767 characters, but if you intend to use it in SQL then you will be limited to returning 4000 characters. Alternatively you can return a CLOB which SQL supports but they are a little more tricky to work with than varchar2...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function ret_str return clob is
      2    v_str clob;
      3  begin
      4    v_str := lpad('*',32767,'*');
      5    return v_str;
      6* end;
    SQL> /
    Function created.
    SQL> select ret_str() from dual;
    RET_STR()
    SQL>

  • Varchar2 variable in Forms_DDL

    hi
    I need to refer to a varchar2 variable within a forms_ddl call e.g
    declare
    myvar varchar2(10) ;
    begin
    forms_ddl ('create or replace view myview as
    select * from emp where job = myvar');
    end;
    how do I make forms_ddl know the value in myvar? I have tried -- job = ' ||myvar||''); and I get ORA-936 missing expression.
    anybody know the solution please help. NB I dont want to hardcode the value of myvar!
    Mbachi

    Hello
    Probably, you are missing quotations. If the "JOB" is a varchar2 column, then make it
    forms_ddl('create or replace view myview as select * from emp where job = '||''''||myvar||'''');
    This should work, if you still get some problems then get back to me at [email protected]
    Regards,
    Asif Momen.

  • Inputing the character 'ł' into a varchar2 variable in an oracle database?

    how do I input the character 'ł' into a varchar2 variable in an oracle database?
    I tried in sql plus or PL/SQL developer, I think the app I need it for is run through Oracle forms. each time it appears as a question mark when I cut and psate it from MS word.

    Can anyone help?

  • PLSQL: Reading variable value from keybord

    In default cursor it is possible to use:
    ACCEPT variable PROMPT "Enter value: ";
    I got a problem while I try to have the message depend on a constant eg. language:
    DECLARE
    v_DATA VARCHAR2(10);
    v_TEXT VARCHAR2(10);
    c_language CONSTANT VARCHAR2(2) := 'PL';
    BEGIN
    CASE c_language
    WHEN ('PL') THEN v_TEXT := "PODAJ DATE";
    ELSE v_TEXT := "ENTER DATE";
    END CASE;
    ACCEPT v_DATA Prompt v_TEXT;
    END;
    Can anybody help me how to properly enter values within PLSQL begin-end statement.
    I suppose it is quite simple but still... :-)

    THX a lot
    And there is another thing.
    In your example the question is asked always in English and is always the standard one "Enter value for ..."
    I need to support 4 language versions and have to ask question in different languages depending on a value of c_language variable, without the "Enter value for ..." :-)
    English user would see (c_language='EN' ):
    Enter the receipt date: {here cursor waiting for entering date}
    Polish user would see (c_language='PL' ):
    Podaj date przyjecia: {here cursor waiting for entering date}
    So now it looks as follows:
    set serveroutput on
    set verify off
    DECLARE
    v_DATA VARCHAR2(10);
    v_QUESTION VARCHAR2(30);
    c_language CONSTANT VARCHAR2(2) := 'EN';
    BEGIN
    CASE c_language
    WHEN ('PL') THEN v_QUESTION := 'PODAJ DATE';
         ELSE v_QUESTION := 'ENTER PO DATE';
    END CASE;
    dbms_output.put_line(v_QUESTION);
    v_DATA := '&v_ENTERED';
    dbms_output.put_line('Entered value:'||v_DATA);
    END;
    Result:
    Enter value for v_entered: 28-08-05
    ENTER PO DATE
    Entered value:28-08-05
    PL/SQL procedure successfully completed.
    SQL>
    Message was edited by:
    user448557

  • BIP truncating long varchar2 values?

    Okay, I readily admit I'm new to BIP, and I may well be making a stupid newbie mistake here.
    I have a relatively simple query defined for a report:
    select cio_s_num, potential_source
    from cio_s_format
    order by cio_s_numwhich is hitting an Oracle 10g schema/table. The 'potential_source' column is a varchar2(500), and there are values that vary in length from 2 chars to 250+.
    When I save this query, and view the output in 'Data' format (aka the generated XML), BIP is truncating all the potential_source values at 175 characters. If I put together a template and generate PDF or HTML output, I see the same truncation.
    The same table and query can be run in SQL*Plus, or in an Apex application, without any truncation problems.
    I've checked for strange/unprintable characters in the data, but found nothing unusual.
    I've tried doing a to_clob() conversion in the query - no change in behavior.
    I've tried outputting length(potential_source) -- it's correct for shorter values but never greater than 175.
    I've tried using substr() to fetch the string in sections -- apparently it sees no data beyond 175.
    Running BIP 10.1.3.4, querying against Oracle 10g.
    Is this a known limitation of BIP that my searches didn't uncover? A bug? A stupid user trick?
    Thanks

    New piece of information to throw in the mix -- a DBA checked a change log, and the POTENTIAL_SOURCE column in the table was at one point altered from varchar2(175) to varchar2(500). The table wasn't rebuilt or anything, a simple ALTER TABLE .. MODIFY command was used.
    Could this be causing the data read problems -- whatever software/driver BI is using to talk to Oracle doesn't look for the "... oh, and there might be more data for that field over HERE" flag?
    I've also tried adding a second long varchar2 column to the query (one our DBA has no record of previous altering), and the second column is NOT truncated. So the general functionality seems fine in our environment, it's some related to this data and/or table.

  • Oracle JDBC truncated my data

    Hi
    I have a situation whereby I send UCS2 encoding to database via JDBC and when it is stored in database the encoding gets truncated.
    Eg.
    send as => 0928, 092f, 0940
    store as => 00, 28, 00, 2f, 00, 40
    Seems like JDBC has truncated my UTF-16 data to UTF-8?
    Can anyone help?!
    Thanks alot!

    Hi,
    This is the output:
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_CHARACTERSET UTF8
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    19 rows selected
    When I do a select asciistr(utf32_col) from table_a; this is what I get.
    ASCIISTR(DESCRIPTION) --------------------------------------------------------------------------------------------------------------------------
    *>\00A0(5@($. 8G5> G ,>0G .G >(>0@, ?( K\00A0* *(G .G(B .G !>2 G      (> 2>-      > 8$G 9Hd
    But the characters are unreadable. When I use Select DUMP to check the characters encoding, this is what i get:
    Typ=1 Len=12 CharacterSet=UTF8: 0,28,0,2e,0,38,0,4d,0,24,0,47
    In fact, I was sending this "&#x928";"&#x92E";"&#x938";"&#x94D";"&#x924";"&#x947". So it appears to me that the higher bytes get truncated. Can you help to explain? Thanks.

  • Numbers in varchar2 variable

    Dear friends,
    i have case like the following example, and i hope you have solution for my problem, lets assume the following:
    declare
    xx varchar2(10);
    begin
    xx := 5 ||','||6;
    select * from emp where emp_no in (xx);
    end ;
    when you run above query it will give invalid number. as the query didn't recognized the numbers inside the variable.
    Thanks in advance

    You want something like this:
    SQL> ed
    Wrote file afiedt.buf
      1  select *
      2  from emp
      3  where ename in (
      4    with t as (select '&input_string' as txt from dual)
      5    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
      6    from t
      7    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
      8*   )
    SQL> /
    Enter value for input_string: SCOTT,JAMES
    old   4:   with t as (select '&input_string' as txt from dual)
    new   4:   with t as (select 'SCOTT,JAMES' as txt from dual)
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 19-04-1987 00:00:00       3000                    20
          7900 JAMES      CLERK           7698 03-12-1981 00:00:00        950                    30
    SQL>Which would also work if the input was numbers and you were comparing against e.g. the empno column.

  • How to retrieve data from IN OUT VARCHAR2 variable of PL/SQL

    Hi, everyone,
    OCCI : OCCI10gR2
    Here is a sample PL/SQL code.
    SQL> CREATE PROCEDURE test4_proc( str IN OUT VARCHAR2 ) IS
    2 BEGIN
    3 str := str || ':' || str;
    4 END;
    And here is a C++ sample code using OCCI.
    std::string sql4 = "BEGIN test4_proc(:1); END;";
    std::string result;
    Statement* stmt4 = conn->createStatement(sql4);
    stmt4->setString(1, "Hello");
    stmt4->registerOutParam(1, OCCISTRING, 12);
    stmt4->executeUpdate();
    result = stmt4->getString(1);
    std::cout << "<" << result << ">" << std::endl;
    Executing this sample code, the output is "<:>" disappointingly.
    I expect that the output would be "<Hello:Hello>"
    Am I wrong ? Please let me know.
    Thanks in advance.

    Hello Shankar,
    Thank you for your instant reply.
    Thanks to you, I can write the sample code that works fine.
    I understand that calling setMaxParamSize() before calling setString() is very important.
    Below is the final sample code that works fine.
    std::string sql4 = "BEGIN test4_proc(:1); END;";
    std::string result;
    Statement* stmt4 = conn->createStatement(sql4);
    stmt4->setMaxParamSize(1, 12); // Important!! Call before setXXX()
    stmt4->setString(1, "Hello");
    stmt4->executeUpdate();
    result = stmt4->getString(1);
    std::cout << "result : <" << result << ">" << std::endl;
    Thank you.

  • Executing PL/SQL from a varchar2 variable

    so i've got an instruction ie:
    test in varchar2;
    test <= TO_DATE('2009-08-27', 'YYYY-MM-DD') ;
    how to execute "test" from inside a stored function/procedure?
    thanks i'm kind of noob, any help would be appreciated :)

    ¿Not sure here whether you've edited your original question, as Toon uses := instead of <=?
    Anyway:
    so i've got an instruction ie:
    test in varchar2;
    test <= TO_DATE('2009-08-27', 'YYYY-MM-DD') ;
    how to execute "test" from inside a stored function/procedure?
    thanks i'm kind of noob, any help would be appreciated :)So, I'm assuming your 'instruction' in human language would be something like:
    "Check if your in-parameter is older or equal to the current present day (a.k.a. SYSDATE)"
    But, WHY you need a stored function/procedure you do not mention.
    So, please read this to begin with, to get the most and maximum out of your questions:
    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    And if my assumption is right, you could do something like:
    MHO%xe> create or replace function date_in_future
      2  (p_date_str in varchar2)
      3  return varchar2
      4  as
      5    rtn varchar2(1);
      6  begin
      7    case when to_date(p_date_str, 'yyyy-mm-dd') > trunc(sysdate)
      8         then rtn := 'Y';
      9         else rtn := 'N';
    10    end case;
    11    --
    12    return rtn;
    13    --
    14  end date_in_future;
    15  /
    Functie is aangemaakt.
    Verstreken: 00:00:00.25
    MHO%xe> select date_in_future('2008-02-12') from dual;
    DATE_IN_FUTURE('2008-02-12')
    N
    Verstreken: 00:00:00.07
    MHO%xe> select date_in_future('2020-02-12') from dual;
    DATE_IN_FUTURE('2020-02-12')
    YBut perhaps a BOOLEAN return or whatever would suit your requirement better.
    But then you'd need to provide a more complete and concisive case/requirement/question.
    Please remember these sites as well in any way, besides OTN, they contain tons of useful stuff (that's an understatement ;) ):
    http://tahiti.oracle.com
    http://asktom.oracle.com

  • How to SELECT * FROM varchar2 variable

    Hi there!
    I want to create a SELECT statement inside a FOR LOOP. With each loop iteration, this SELECT shall get data from a different table:
    FOR R_CURSOR IN C_CURSOR LOOP
    V_FROM_CLAUSE := R_CURSOR.TABLE;
    SELECT *
    INTO V_RESULT
    FROM V_FROM_CLAUSE:
    Obviously, this doesn't work (it might be possible that a table/view has exactly the name as the variable). But is there any possibility to create a statement like this? Please help me out :-)
    Regards,
    Thomas

    you need dynamic sql:
    EXECUTE IMMEDIATE
    'SELECT * INTO V_RESULT FROM ' || V_FROM_CLAUSE

Maybe you are looking for

  • Coverage

    I'm very upset lately with the coverage that I'm receiving from Verizon.  For this company to be the #1 covered area in the US you would figure we wouldn't have so many dropped calls.  Recently my husband and I had to buy a booster for our home just

  • Question about DVI Cables

    I was wondering how I could connect the following DVI ports. There are many cables out there and would like to know which one can correctly connect them. This is the DVI port on my tv: http://img165.imageshack.us/my.php?image=tvwi8.png And this is th

  • Disk Size reported incorrectly

    I have a new Solaris 10 installation on a Dell 2450 using 4 73GB SCSI disks. The OS reports the disks as being 17.8GB in the format command. How do I correct this problem. I don't know enough about the detailed workings of Solaris to even start looki

  • IPhone 4 pictures bad quality?

    I recently got a new iPhone 4 and noticed that the pictures are mostly overexposed and sometimes the edges of people distorted, what coul be the problem? With my l old iPhone 4 I always got great pictures. Is the iPhone deffect or is it a hardware pr

  • How do i clear the receiver and send buffer?

    I am trying to communicate with the Votsch 3050 thermal chamber, with LabVIEW as the control software via serial RS232. In sending the required ASCII strings, there was no response from the chamber, yet no error. The manufacturers indicate clearing t