Informix: Point Value (.)?

Hi guys, I am wondering if anyone can tell me any special meaning of dot (.) In Informix regarding expressions etc.

For example, in stored procedures, I see that it is used with integers, decimals and symbols, and one thing that annoys me very much:

if value = '.' then
  //do something
end if

The above expression confirms true when the value is of type numeric (5,1) and it is 0.0

I tried to look around, and I can not find information about how the point is processed, but it seems "0.0 =". "validates ...

Can someone enlighten me please?

thank

+3
source share
1 answer

, ?

. , ; , ( NULL) , , '.', '.' , (, , , ).

, , , , , SPL. SPL "end if", I4GL . , SPL ( ) END BEGIN.


, .

, , ...

+ set debug file to "/tmp/x1";
SET DEBUG FILE TO: Rows processed = 0
+ drop procedure so2139024();
DROP PROCEDURE: Rows processed = 0
+ create procedure so2139024() returning int as rv;

    define value numeric(5,1);
    define rv integer;
    trace on;

    let rv = 0;
    let value = 0.0;
    if value = '.' then
        let rv = 1;
    end if;

    return rv;

end procedure;
CREATE PROCEDURE: Rows processed = 0
+ execute procedure so2139024();
1
EXECUTE PROCEDURE: Rows processed = 1

, - ; . MacOS X 10.6.2 IBM Informix Dynamic Server 11.50.FC6 ( SQLCMD 86.04, CSDK 3.50.FC4, 3.50.FC6).

:

trace on

expression:(= value, ".")
evaluates to t 
let rv = 1 
expression:rv
evaluates to 1 
procedure so2139024 returns 1 

iteration of cursory procedure so2139024

, IBM/Informix Tech Support. , , , - , , . .


, , deccvasc() ESQL/C ( ) ".".

ESQL/C , :

#include <stdio.h>
#include "dumpesql.h"

int main(void)
{
    dec_t d;

    int rc = deccvasc(".", 1, &d);
    printf("rc = %d\n", rc);
    dump_decimal(stdout, "Decimal", &d);
    return(0);
}

dump_decimal() , . :

rc = 0
DECIMAL: Decimal -- address 0x7FFF5FBFF090
E:  -64, S = 1 (+), N =  0, M = value is ZERO

, () '.' , . , - , , . ( , .) IBM/Informix Technical Support.

+2

Source: https://habr.com/ru/post/1730037/


All Articles