DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: what is the format of ORACLE RETURN VALUE

  1. #1
    Join Date
    Mar 2001
    Posts
    19
    Team,

    I am trying this query in my database and it is returning me a value which i couldnt able to trap in java.

    Here is my query

    select max(id) from messages where id > 200 and parentid=0;

    There is no result for this query and oracle is returningme a value i am retriving this value in my java code and tried the following:

    if ( value == " ") and
    if ( value == null ) it is not matching this clause at all.

    What is the value which should i match if there is no matching value for the query.

    thanks in advance
    Seenu

  2. #2
    Join Date
    Jun 2001
    Posts
    29
    I have not worked with java and sql, so this is speculation...

    When exiting sql*plus from unix, the return code for success is 0. You might check for a numeric value instead of space or null.
    Daniel W. Fink
    oracledba@ix.netcom.com

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    I also have almost no experience with java. But I should look in this direction:

    Two null values are never equal. That is why in SQL and PL/SQL if the variable VAR has NULL value, the following:

    var = NULL

    will return FALSE, while the following will return TRUE:

    var IS NULL.


    So try to find if in java there is something similar like

    if (value IS null)

    instead of

    if ( value == null )
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  4. #4
    Join Date
    Sep 2000
    Posts
    41
    Hi,
    Instead of try like

    if (var == " ")

    try

    if (var == "")

    and see what happens......


    Regards

    Amit

Posting Permissions

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


Click Here to Expand Forum to Full Width