powered by simpleCommunicator - 2.0.59     © 2025 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Проблема с созданием UDTF
4 сообщений из 4, страница 1 из 1
Проблема с созданием UDTF
    #38916560
Да ну
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Что я делаю не так?

Выполняю:
Код: plsql
1.
2.
3.
4.
5.
6.
7.
CREATE FUNCTION Fnc33 ()     
       RETURNS TABLE (aa varchar(128))  
       LANGUAGE SQL                            
       READS SQL DATA  
BEGIN                                                              
    RETURN select * from (select tabname from syscat.tables);
END;


Получаю:
Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
CREATE FUNCTION Fnc33 ()     
       RETURNS TABLE (aa varchar(128))  
       LANGUAGE SQL                            
       READS SQL DATA  
BEGIN                                                              
    RETURN select * from (select tabname from syscat.tables)
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "tabname" was found following "elect * from 
(select".  Expected tokens may include:  "<space>".  LINE NUMBER=6.  
SQLSTATE=42601

END
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "END-OF-STATEMENT" was found following "END".  
Expected tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601

SQL0104N  An unexpected token "END-OF-STATEMENT" was found following "END".  Expected tokens may include:  "JOIN <joined_table>                              ".

Explanation: 

A syntax error in the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure was detected at the specified token
following the text "<text>". The "<text>" field indicates the 20
characters of the SQL statement or the input command string for the
SYSPROC.ADMIN_CMD procedure that preceded the token that is not valid.

As an aid, a partial list of valid tokens is provided in the SQLERRM
field of the SQLCA as "<token-list>". This list assumes the statement is
correct to that point.

This message can be returned when text is passed to the command line
processor (CLP) in command mode and the text contains special characters
that are interpreted by the operating system shell, such as single or
double quotes, which are not identified with an escape character.

The statement cannot be processed.

User response: 

Respond to this error in one of the following ways:

*  Examine and correct the statement in the area of the specified token.
*  If you are using the CLP in command mode and there are any special
   characters, such as quotes, in the command, use an escape character,
   such as the backslash character, to cause the operating system shell
   to not take any special action for those special characters. You
   could also issue the statement using CLP in interactive mode or batch
   mode to avoid any processing of special characters by the operating
   system shell.

sqlcode: -104

sqlstate: 42601


   Related information
   Command line processor features

...
Рейтинг: 0 / 0
Проблема с созданием UDTF
    #38916625
Mark Barinstein
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Да ну,

Код: plaintext
1.
2.
3.
4.
5.
6.
CREATE FUNCTION Fnc33 ()     
       RETURNS TABLE (aa varchar(128))  
       LANGUAGE SQL                            
       READS SQL DATA  
BEGIN
    RETURN select * from (select tabname from syscat.tables);
END;
...
Рейтинг: 0 / 0
Проблема с созданием UDTF
    #38916630
Mark Barinstein
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Да ну,

Или

Код: plaintext
1.
2.
3.
4.
5.
6.
CREATE FUNCTION Fnc33 ()     
       RETURNS TABLE (aa varchar(128))  
       LANGUAGE SQL                            
       READS SQL DATA  
BEGIN ATOMIC
    RETURN select * from (select tabname from syscat.tables);
END@
...
Рейтинг: 0 / 0
Проблема с созданием UDTF
    #38916735
Да ну
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Mark Barinstein,

Спасибо - теперь понятно куда рыть.
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / IBM DB2, WebSphere, IMS, U2 [игнор отключен] [закрыт для гостей] / Проблема с созданием UDTF
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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