powered by simpleCommunicator - 2.0.60     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / External UDF и *LIBL
3 сообщений из 3, страница 1 из 1
External UDF и *LIBL
    #35640248
MindWrapper
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Привет.
Есть определение внешней функции:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
CREATE FUNCTION MYFUNC (INT) RETURNS INT                        
LANGUAGE C++ SQL                                                  
EXTERNAL NAME 'MYLIB/MYSRVPGM(func__FPiT1PsT) '
NOT DETERMINISTIC                                                 
NO SQL                                                            
NOT FENCED                                                        
EXTERNAL ACTION                                                   
RETURNS NULL ON NULL INPUT                                        

можно ли както-то вместо узазания конкретной библиотеки специфицировать *LIBL ?

При попытке это сделать я получаю ошибку:
автор
*LIBL contains a character that is not allowed or does not contain any characters. An ordinary identifier must begin with (A-Z, $, #, or @) and be followed by zero or more (A-Z, 0-9, $, #, @, or _). A delimited identifier is a string of characters within SQL escape characters. The characters allowed in delimited names depends on the type of name. -- The characters between the escape characters for system table names, schema names, package names and other system object names can be any characters except Hex 00-3F, Hex 40 (space), Hex 5C (*), Hex 6F (?), Hex 7D ('), Hex 7F ("), and Hex FF. -- The characters between the escape characters for SQL table names, cursor names, statement names, correlation names, column names, procedure names, function names, parameter names, constraint names, user-defined type names, trigger names, or sequence names can be any characters except Hex 00-3F and Hex FF. -- Delimited system column names must begin with (A-Z, $, #, or @) and be followed by zero or more (A-Z, 0-9, $, #, @, or an _). A relational database name must begin with A-Z and be followed by 0 or more letters, numbers 0-9, or an _. Ordinary identifiers that are contained within host variables must not include lowercase letters because they are not converted to uppercase. Recovery . . . : Correct the name. Try the request again.


Заранее
...
Рейтинг: 0 / 0
External UDF и *LIBL
    #35643098
Vladimir Kiselev
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
MindWrapper,

За С++ ничего не скажу, есть только рабочий пример на C:

CREATE PROCEDURE SCHEMA.FUNC_NAME
(
INOUT ID INTEGER,
IN FNAME CHARACTER(20),
OUT ERRORCODE INTEGER
)
DYNAMIC RESULT SETS 0
EXTERNAL NAME 'dll_name!funcname'
LANGUAGE C
PARAMETER STYLE DB2DARI
NOT DETERMINISTIC
FENCED NOT THREADSAFE
MODIFIES SQL DATA
NO DBINFO;

Предполагаю, что проблема в символе "/". Впрочем утверждать не буду, возможно не совсем правильно понял вопрос.
...
Рейтинг: 0 / 0
External UDF и *LIBL
    #35643118
Mark Barinstein
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Добрый день.
MindWrapperЕсть определение внешней функции:

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
CREATE FUNCTION MYFUNC (INT) RETURNS INT                        
LANGUAGE C++ SQL                                                  
EXTERNAL NAME 'MYLIB/MYSRVPGM(func__FPiT1PsT) '
NOT DETERMINISTIC                                                 
NO SQL                                                            
NOT FENCED                                                        
EXTERNAL ACTION                                                   
RETURNS NULL ON NULL INPUT                                        

можно ли както-то вместо узазания конкретной библиотеки специфицировать *LIBL ?
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/db2/rbafzmstcfsce.htm
Так написано в описании create functoin :

EXTERNAL NAME external-program-name
Specifies the program, service program, or java class that will be executed when the function is invoked in an SQL statement. The name must identify a program, service program, or java class that exists at the application server at the time the function is invoked. If the naming option is *SYS and the name is not qualified:

- The current path will be used to search for the program or service program at the time the function is invoked.
- *LIBL will be used to search for the program or service program at the time grants or revokes are performed on the function.


Т.е. попробуйте при naming convention *SYS не указывать имя библиотеки - оно должно попытаться найти файл в CURRENT PATH, затем в *LIBL.
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / External UDF и *LIBL
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]