![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello. UDB DB2 v8.2.1 for LUW. Why this function can't be compiled? --- CREATE FUNCTION MYLIKE(NM VARCHAR(128)) LANGUAGE SQL RETURNS INTEGER BEGIN ATOMIC RETURN ( SELECT COUNT(1) FROM SYSCAT.TABLES WHERE TABNAME LIKE MYLIKE.NM ); END@ --- SP with like with host variable is compiled successfully. I think it is a bug. I think it would be easier to guess the problem if you told us the error |
#3
| |||
| |||
|
|
4.spam (AT) mail (DOT) ru> wrote in message news:1148032926.171923.113140 (AT) i40g2000cwc (DOT) googlegroups.com... Hello. UDB DB2 v8.2.1 for LUW. Why this function can't be compiled? --- CREATE FUNCTION MYLIKE(NM VARCHAR(128)) LANGUAGE SQL RETURNS INTEGER BEGIN ATOMIC RETURN ( SELECT COUNT(1) FROM SYSCAT.TABLES WHERE TABNAME LIKE MYLIKE.NM ); END@ --- SP with like with host variable is compiled successfully. I think it is a bug. It a known limitation. |
#4
| |||
| |||
|
|
It a known limitation. Local variables and parameters cannot be used in LIKE patterns in "inline" SQL PL (That is SQL functions and triggers). |
#5
| |||
| |||
|
|
Is it described somewhere in documentation? I'd like to read about other SQL UDF limitations. Yes and no. The explanation for LIKE says that the pattern must be a |
![]() |
| Thread Tools | |
| Display Modes | |
| |