Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2011
    Posts
    32

    Question Unanswered: Error Code: -1260, SQL State: IX000 ????

    Hi,

    I have this sample query to test and incorporate in a stored proc, and it throws the error, "Error Code: -1260, SQL State: IX000". The error description says, It is not possible to convert between the specified types.

    Pl let me know what am I doing wrong here?
    Code:
    CREATE PROCEDURE yunus.test_sp
    () returning boolean;
    BEGIN
     define strSource char(20);
     define retVal boolean;
     
     let retVal = 'false';
     let strSource = 'ST_PETER';
     
     if (substr(strSource, 3, -3) = 'ST_')
            then let retVal = 'true';
     else
            let retVal = 'false';
    END if;
    return retVal;
    END;
    END PROCEDURE;
    Last edited by ab_yunus; 03-12-12 at 14:52.

  2. #2
    Join Date
    Aug 2011
    Posts
    32

    Exclamation weird

    yes. weird, but when i changed the return type to char(5), and defined the variable appropriately, this one worked with no errors.

    Question: Shouldnt a stored proc in informix return a boolean??

  3. #3
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi,


    an informix stored procedure returns what you ask it to return, that is any Informix supported datatype.

    when you create a stored procedure, you must specify the type of data it returns, ex:
    create procedure myprocedure returning char(5), or
    create procedure myprocedure returning integer, or
    create procedure myprocedure returning date
    etc....

  4. #4
    Join Date
    Aug 2011
    Posts
    32
    Hi,

    Yes I did specify the return type. i wanted it to return boolean. See the snippet.

    Code:
    CREATE PROCEDURE yunus.test_sp
    () returning boolean;
    And i have defined the return variable also, but still it was throwing that error...?

  5. #5
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    What is your Informix version?

    I think the boolean datatype is not supported before 11.10 ( have to check though).
    In any case, it compiles perfect with 11.70.

    If your version doesn't have this datatype, replace the boolean by a smallint, and values by 0 and 1 and check the result

  6. #6
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Humm just tested .... same as you.

    There seem to have 'funny things' regarding the boolean datatype. In fact this is not a 'native' datatype, and there seems to have issues with it.

    Can you allow me some time for me to test? Else use the smallint workaround: not brrrilliant but can help for the moment...

  7. #7
    Join Date
    Aug 2011
    Posts
    32
    my informix version it says is OWNER- 9.53C1.

    I did ran the SP, using char(5) and storing values like 'true', 'false' etc. so that's a workaround still. take your time and let me know when you get it Thank you

  8. #8
    Join Date
    Mar 2012
    Location
    Somewhere In Europe
    Posts
    24
    Hi
    Imho, you should use 't' and 'f' instaead of 'true' and 'false' becouse

    the BOOLEAN data type is a 1-byte data type. The legal values for Boolean are true ('t'), false ('f'), or NULL. The values are not case sensitive.

    Regards
    Mike

Tags for this Thread

Posting Permissions

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