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

    Question Unanswered: Case inSeneitive String comparision in Informix

    Hello,

    I am getting input params for my stored procedure from vxml. Now, I would like to know if I can check whether some input param is "undefined" or "notset" irrespective of the case.

    for ex: the java code for this looks like:
    Code:
    if (ZipCode != null) {
    	if (ZipCode.equalsIgnoreCase("undefined")
    		|| ZipCode.equalsIgnoreCase("NotSet"))
    		ZipCode = null;
    }
    I want to replicate that in informix, in SP. Is there any simpler way to do that? or are there any built in functions? Pl help. Thank you.

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

    very simple, use the built-in functions UPPER or LOWER , and compare with the string also converted to upper or lower.

    like this:
    Code:
    create procedure myproc (inparam CHAR(10)) returning integer ;
    IF ( UPPER(inparam) = "TEST" ) THEN
       RETURN 1;
    ELSE
       RETURN 0;
    END IF
    END PROCEDURE;
    execute procedure myproc ("TesT") ;
    execute procedure myproc ("ResT") ;

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
  •