This is in continuation of other posts that I had for db2 executing dynamic query..
I have a situation where I get insert statement query as a column value in db2 and I am executing the insert query in db2 ..
Table test_query in db2 has column query1 varchar(4000) and it has value 'insert into test_cs values (select ... from table...)
initially I had test_cs table to have only 1 column as GB_Value decimal(22,3) and then I wrote the stored procedure in db2 to execute the above query..
Now in reality the table test_cs has more than 1 column, it will have id column and will have value like sequence number and a description column as to what it inserts
The table test_cs has the following columns
I changed the test_query table to have the query1 column value to be insert into test_cs (id_value,description,gb_value) values (1,'This is a test','select <blah blah> from table')
I tried my stored procedure but I have problems now,.
A database manager error occurred.[IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "1" was found following "values,". Expected tokens may include: space
Any ideas as to how to make this work..