Error Sql0104n
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About sql0104n an unexpected token was found following identifier Us Learn more about Stack Overflow the company Business Learn more about hiring
An Unexpected Token Was Found Following . Expected Tokens May Include
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the expected tokens may include: "". sqlstate=42601 Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why am I getting this SQL/DB http://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00104n.html error? up vote 1 down vote favorite 1 I am trying to run a simple SQL statement with DB2 and am having a few problems. I would like to have a single script in a txt/db2 file and have the engine process all of the commands Here is the script: CONNECT TO MYDB CREATE TABLE PERSONS( PID SMALLINT NOT NULL, NAME VARCHAR(20) NOT NULL ) TERMINATE http://stackoverflow.com/questions/568263/why-am-i-getting-this-sql-db-error When I run a db2 -f /pathtofile I get: SQL0104N An unexpected token "(" was found following "CREATE TABLE PERSONS". Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601 What am I doing wrong? Is there something wrong with my script? Also, why is it working without ";" terminators at the end of my statements? Thank you, sql db2 share|improve this question edited Feb 20 '09 at 4:56 asked Feb 20 '09 at 4:17 barfoon 9,5141968126 What happens when you type your statements into the db2 command interpreter? –Jim Counts Feb 20 '09 at 6:17 add a comment| 4 Answers 4 active oldest votes up vote 1 down vote accepted May be this will be of help, http://www.uc.edu/R/r25/documentation/Version3.2/install_instructions.pdf: The scripts use a semi-colon (;) to terminate each SQL command. If you use the DB2 Command Line Processor, you should remember to use the “-t” flag. ... If you do not use the -t flag, you will get errors such as the following upon running the db2ct32.sql script: create table “ACCOUNTS” ( 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 un
help? Post your question and get tips & solutions from a community of 418,546 IT Pros & https://bytes.com/topic/db2/answers/185569-error-sql0104n-very-simple-client-setup-help Developers. It's quick & easy. Error SQL0104N on very simple client setup. http://www.dbforums.com/showthread.php?1673738-SQLSTATE-42601-error Help. P: n/a Pradeep DB2ers, In my setup, DB2 server is installed on a Windows box "test16" and "SAMPLE" database has been loaded. Now, on a clean Windows machine (test15), I installed DB2 client (DB2Clienten_US_setup.exe). From the instructions on the net, the first thing I must an unexpected do on the client machine (test15) is to catalog the tcpip node. db2 => catalog tcpip node db2test16 remote test16 server 50000 If I do that, I am getting the following error: SQL0104N An unexpected token "db2test16" was found following "NODE". Expected tokens may include: "". SQLSTATE=42601 Can someone please tell me if there is another step that I an unexpected token missed? The network connectivity is okay. I can ping between test16 and test15. Thank you in advance for your help. Pradeep Nov 12 '05 #1 Post Reply Share this Question 2 Replies P: n/a Visu Your nodename (db2test16) should be lessthan or equal to 8chars Nov 12 '05 #2 P: n/a Pradeep Visu, Thank you for your help. That fixed the problem. Pradeep Nov 12 '05 #3 This discussion thread is closed Start new discussion Replies have been disabled for this discussion. Similar topics Sockets: Send bad address error on localhost connection Need Help: Error while creating Store Procedure Deploying application got error CREATE PARTITIONED TABLE - SQL0104N error Switchboard Error Please Help Setup Error msg when program loads SQL0104N Error Client version higher than DB causes error How to intercept error when httpRuntime maxRequestLength is exceded. Browse more DB2 Database Questions on Bytes Question stats viewed: 3603 replies: 2 date asked: Nov 12 '05 Follow this discussion BYTES.COM 2016 Formerly "TheScripts.com" from 2005-2008 About Bytes | Advertise on Bytes | Contac
the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 8 of 8 Thread: SQLSTATE=42601 error Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 01-20-12,10:29 #1 aarjay View Profile View Forum Posts Registered User Join Date Jan 2012 Posts 4 Unanswered: SQLSTATE=42601 error I am using DB2 9.7.0.441 version on a Windows XP 2002 SP3 I have a few .SQL files that are given to me. I have created a database (COGOPS) and using the command editor I am trying to create tables, views, triggers in the COGOPS database. I was able to create the tables using one of the .sql files. However when running the following: BEGIN DECLARE Rec_Count, v_curr_category_num, v_dept_compl_ind, v_curr_dept_compl_ind, v_station_compl_ind, v_curr_station_compl_ind INTEGER; it gives me the following error: 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 "_compl_ind INTEGER". Expected tokens may include: "". LINE NUMBER=10. SQLSTATE=42601 What could be the problem and solution? Reply With Quote 01-20-12,10:36 #2 ARWinner View Profile View Forum Posts Registered User Join Date Jan 2003 Posts 4,286 Provided Answers: 5 It is your statement delimiter. It normally defaults to the semicolon, but when you use compound statements you cannot use the semicolon as the statement delimiter. The entire statement is the BEGIN through the END, so the statement delimiter needs to be something else. Most people use an @. Andy Reply With Quote 01-20-12,12:19 #3 aarjay View Profile View Forum Posts Registered User Join Date Jan 2012 Posts 4 Ok. I have replaced the semicolons with the @ sign everywhere. and my scripts looks like: SET CURRENT SCHEMA = "COGOPS"; SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","SYSIBMADM","COGOP S"; CREATE OR REPLACE TRIGGER "COGOPS"."DVI_TRANSACTIONS_POST_INS_TRG" AFTER INSERT ON "COGOPS"."DVI_TRANSACTIONS" REF