Subject | bin_and() in Firebird 2.5.2 |
---|---|
Author | Keisuke Kumakura |
Post date | 2013-10-29T00:34:23Z |
Hello,
The SQL statement:
select some from foo where bin_and(bar, '2')<>0;
results in the error:
Arguments for BIN_AND must be integral types or NUMERIC/DECIMAL without
scale
But if we omit single quote around 2(i.e., bin_and(bar, 2)<>0),
the statement is executed fine.
If we declare the following function, the statement is
executed fine irrespective of bin_and(bar, '2') or bin_and(bar, 2).
DECLARE EXTERNAL FUNCTION bin_and
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_and' MODULE_NAME 'ib_udf';
a. Is it illegal to single-quote numeric(e.g., '2') ?
b. Does overriding internal bin_and, bin_or functions pose
any problems for firebird utilities like gbak, nbackup and
others ?
regards,
K. Kumakura
The SQL statement:
select some from foo where bin_and(bar, '2')<>0;
results in the error:
Arguments for BIN_AND must be integral types or NUMERIC/DECIMAL without
scale
But if we omit single quote around 2(i.e., bin_and(bar, 2)<>0),
the statement is executed fine.
If we declare the following function, the statement is
executed fine irrespective of bin_and(bar, '2') or bin_and(bar, 2).
DECLARE EXTERNAL FUNCTION bin_and
INTEGER, INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_bin_and' MODULE_NAME 'ib_udf';
a. Is it illegal to single-quote numeric(e.g., '2') ?
b. Does overriding internal bin_and, bin_or functions pose
any problems for firebird utilities like gbak, nbackup and
others ?
regards,
K. Kumakura