473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SQL0104N in Command Center - Interactive

Why do I get SQL0104N in UDB 8.1 for Windows Command Center -
Interactive, when I copy-paste-and-execute this function from the
docs?

FWIW I have % defined as the statement terminator, but appending a %
to the input just gives a different error: SQL0007N The character "%"
following "BEGIN-OF-STATEMENT" is not valid.

Here's the function from the docs:

CREATE FUNCTION TAN (X DOUBLE)
RETURNS DOUBLE
LANGUAGE SQL
CONTAINS SQL
NO EXTERNAL ACTION
DETERMINISTIC
RETURN SIN(X)/COS(X)

Here's the full error message:

SQL0104N An unexpected token "RETURN SIN(X)/" was found
following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<create_view> ".

Explanation:

A syntax error in the SQL statement was detected at the specified
token following the text "<text>". The "<text>" field indicates
the 20 characters of the SQL statement that preceded the token
that is not valid.
Nov 12 '05 #1
4 9679
Makes no sense.
DB2 seems to swallow everything but the last line.
The % won't make a difference. Command Center will add it for you if
it's not there
What happend is that you added % to the next line and now % is begining
of statement.

Must be something glaringly obvious .. in hindsight.
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
Breck Carter wrote:
Why do I get SQL0104N in UDB 8.1 for Windows Command Center -
Interactive, when I copy-paste-and-execute this function from the
docs?

FWIW I have % defined as the statement terminator, but appending a %
to the input just gives a different error: SQL0007N The character "%"
following "BEGIN-OF-STATEMENT" is not valid.

Here's the function from the docs:

CREATE FUNCTION TAN (X DOUBLE)
RETURNS DOUBLE
LANGUAGE SQL
CONTAINS SQL
NO EXTERNAL ACTION
DETERMINISTIC
RETURN SIN(X)/COS(X)

Here's the full error message:

SQL0104N An unexpected token "RETURN SIN(X)/" was found
following "BEGIN-OF-STATEMENT". Expected tokens may include:
"<create_view> ".

Explanation:

A syntax error in the SQL statement was detected at the specified
token following the text "<text>". The "<text>" field indicates
the 20 characters of the SQL statement that preceded the token
that is not valid.


For what it is worth I tried this in Stinger - after defining statemetn
termination character as '@' I also got -104 in Command Editor.
After quitting and restarting Command Editor - function was created
successfully.
Perhaps you defined statement termination character in the same session
in which yoy tried to define function? I am thinking that this
'settings' or 'property' is acted upon only during tool initialization.
Another suggestion to try is to avoid characters '%' and '_' as
statement termination as those are valid SQL wild characters used in
LIKE predicates.

Jan M. Nelken
Nov 12 '05 #3
I'm quite certain I have changed teh termination character in flight in
the past. And I use % myself.
One more thought though:
There is a ticky to switch it on as well as a field to enter the
character. If thi ticky is NOT on.
Then DB2 will interprete each line as a separate command.
So what you would see is just the last error.... ?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
Thanks for your help!

The Tools Settings - "Use statement termination character" was checked
initially and I left it alone. All I did was change the character from
";" to "%". I also stopped and started Command Center several times.

HOWEVER, this morning when I started Command Center, "Use statement
termination character" was UNchecked. When I checked it, everything
worked OK. I do not know why it was unchecked.

As far as I can tell, you can change the termination character in
flight, but you also have to uncheck and check "Use statement
termination character" or subsequent behavior is strange.

If someone suggests my workstation is under a voodoo spell, I won't
argue :)

Breck

Serge Rielau <sr*****@ca.eye-be-em.com> wrote in message news:<cb**********@hanover.torolab.ibm.com>...
I'm quite certain I have changed teh termination character in flight in
the past. And I use % myself.
One more thought though:
There is a ticky to switch it on as well as a field to enter the
character. If thi ticky is NOT on.
Then DB2 will interprete each line as a separate command.
So what you would see is just the last error.... ?

Cheers
Serge

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Nau | last post by:
I'm using command center to view my data. When I enter a query on the interactive tab, once executed it takes me to the results tab but doesn't display anything. If I enter the same query in the...
1
by: sea | last post by:
When typing queries in the DB2 command center interactive mode (workgroup 8.1) I find that after a certain number of queries have been executed successfully the program suddenly seems to come to a...
3
by: GB | last post by:
After having established a connection to my local db using tcp/ip I run a simple select request. I allways get following error when using the interactive tab in the command center: "DBA2192...
3
by: Tuang | last post by:
I'd like to create my own mini "IDE" for working with several programming languages that provide interactive "toplevel" command line interpreters, such as Python, Ruby, Lisp, Scheme, OCaml, etc....
0
by: ALLYWEIR | last post by:
Hi, I am trying to create a partitoned table using the following:- CREATE TABLE ORDERS(ID INT, SHIPDATE DATE) PARTITION BY RANGE(SHIPDATE) ( STARTING '1/1/2006' ENDING...
0
by: vrama11 | last post by:
Hi, I am using DB2 V9.1.300.257 on Windows. When I try to get the visual explain plan for a query from the command editor, it gives the following error: SQL0104N An unexpected token "WITH...
4
by: Justin | last post by:
Excuted the statement through a SSH connection: db2 import from <filename.ixfof ixf messages /database/stage/ acct_news_asc.txt insert into userid.acct_news_asc And it worked fine. Ran the...
1
by: kfwolf | last post by:
Excuted the statement through a SSH connection: db2 load from <filename.ixf> of ixf messages /database/stage/ acct_news_asc.txt insert into userid.acct_news_asc And it worked fine. ...
1
by: Justin | last post by:
We had a load that failed. Now we have a pending load. When executing load terminate, we receive the following error: db2 load terminate SQL0104N An unexpected token "terminate" was found...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.