Db2 Sql Error End Of Statement
a DB2 script even if it is commented out? Technote (FAQ) Question Does the statement termination symbol ';' db2 sql case statement get detected by a DB2 script even if it is commented db2 sql if statement out? Answer Yes, the statement termination symbol will get detected by a DB2 script even if it db2 sql case statement multiple conditions is placed within a comment. This behavior can be observed by running the following tests : Create a table as follows : >db2 create table tpo(id int) DB20000I
Db2 Sql Case Statement In Where Clause
The SQL command completed successfully. Test 1 : Create a batch file tpo.bat, with the following contents : insert into tpo values(10); insert into tpo values(20); Execute the script : >db2 -tvf tpo.bat insert into tpo values(10) DB20000I The SQL command completed successfully. insert into tpo values(20) DB20000I The SQL command completed successfully. >db2 select db2 sql case statement in select * from tpo ID ----------- 10 20 ie. it works properly as expected. Test 2 : Alter the batch file tpo.bat, with the following contents : insert into tpo values(10); insert into tpo values(20);--insert into tpo values(30); Execute the script : >db2 -tvf tpo.bat insert into tpo values(10) DB20000I The SQL command completed successfully. insert into tpo values(20);--insert into tpo values(30) 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 ";" was found following "into TPO values(20)". Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601 >db2 select * from tpo ID ----------- 10 Observation : After the comment '--', the text "insert into tpo values(30)" gets ignored because it is commented out, but however the statement termination character(Semicolon) gets detected even though it is also commented out. It therefore causes the following error to be returned : SQL0104N An unexpected token ";" was found following "into TPO values(20)". Expected tokens
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 Us Learn more about Stack Overflow the company Business Learn more db2 sql case statement example in select about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Db2 Sql Case Statement In Update
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Db2 Sql Case Statement With Group By
each other. Join them; it only takes a minute: Sign up DB2 An unexpected token “END-OF-STATEMENT” was found following “LIST TABLES” up vote 0 down vote favorite I am a first time DB2 user, have trouble in executing http://www-01.ibm.com/support/docview.wss?uid=swg21614891 "list tables;" in IBM Data Studio. I can run "select" commands (end with semicolon) and "update commands" but "list tables;" (both with and without semicolon) gives following error: An unexpected token "END-OF-STATEMENT" was found following "LIST TABLES". Expected tokens may include: "JOIN ".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.14.113 Update: Alternatively, the following command works: select tabname from syscat.tables where tabschema = 'whatever-schema-name'; BTW, is it possible to change the default query result window from "Status" to "Result1". It is http://stackoverflow.com/questions/14101953/db2-an-unexpected-token-end-of-statement-was-found-following-list-tables in "Status" window by default and every time I have to click "Result1" tab to see the query result. db2 share|improve this question edited Dec 31 '12 at 13:35 asked Dec 31 '12 at 13:02 wlin 2518 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote I am not sure about what I am going to say, but Data Studio is only for SQL commands. List table command is not a DDL, DML nor DCL, and for this reason, you cannot execute that command from the SQL editor in Data Studio. Those commands are for the CLP. share|improve this answer answered Jan 3 '13 at 14:58 AngocA 5,75621744 add a comment| up vote 0 down vote use list all the tables in the DB as given below db2 list tables for all use list all the tables in the Schema as given below db2 list tables for schema scheme_Name share|improve this answer edited Jan 3 '14 at 7:24 answered Dec 30 '13 at 6:35 Dhanish Jose 5081517 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of serv
here for a quick overview of the http://stackoverflow.com/questions/15117777/c-sharp-db2-error-an-unexpected-token-end-of-statement-was-found-following site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs db2 sql Documentation Tags Users Badges Ask Question x Dismiss Join the 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 C# & DB2 Error: An unexpected token “END-OF-STATEMENT” db2 sql case was found following “get_profile_internet”" up vote 1 down vote favorite I'm getting the following error message when I try to call a DB2 stored procedure from my C# Code: ERROR [42601] [IBM][CLI Driver][DB2/NT64] SQL0104N An unexpected token "END-OF-STATEMENT" was found following "get_profile_internet". Expected tokens may include: "JOIN ". SQLSTATE=42601 What am I doing wrong? Here's the DB2 - Stored procedure code create procedure db2admin.pr_get_profile_internet ( IN p_profile_internet_id INT ) BEGIN DELCARE c_profile_internet CURSOR WITH RETURN TO CLIENT FOR SELECT * FROM profile_internet WHERE profile_internet_id = p_profile_internet_id; OPEN c_profile_internet; END; Here's my C# Code public CDataResult GetProfileInternet() { string v_connection_string = General.GetDBConnection(); CDataResult v_result = new CDataResult(); OdbcConnection v_connection = new OdbcConnection(v_connection_string); try { // Open Connection v_connection.Open(); OdbcCommand cmd = new OdbcCommand("db2admin.pr_get_profile_internet", v_connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("p_profile_internet_id", OdbcType.Int); cmd.Parameters["p_profile_internet_id"].Value = this.ProfileInternetId; OdbcDa