Ray
asked on
querying from Excel and using multiple statements separated by semicolon
I am trying to feed this query to a DB2 database via excel. I get an error message back from the db that is complaining about syntax of a semicolon.
When I run the exact same text as a query in a native db query application it runs just fine, no issues.
Any thoughts on why sending this via Excel is a problem?
Any way to get around it aside from running each one as a separate query?
drop alias qtemp.zz1 ; drop alias qtemp.zz2 ; drop alias qtemp.zz3 ; drop alias qtemp.zz4 ; drop alias qtemp.zz5 ;
When I run the exact same text as a query in a native db query application it runs just fine, no issues.
Any thoughts on why sending this via Excel is a problem?
Any way to get around it aside from running each one as a separate query?
drop alias qtemp.zz1 ; drop alias qtemp.zz2 ; drop alias qtemp.zz3 ; drop alias qtemp.zz4 ; drop alias qtemp.zz5 ;
What is the exact error-message that you receive?
ASKER
Dave,
It is attached but it won't tell you anything. I get the exact same error even running ONE of those (such as: drop alias qtemp.zz1 ; ) if I include the semicolon.
The bottom line appears to be that passing a semicolon to a query engine via VBA is problematic.
semicolon-error.PNG
It is attached but it won't tell you anything. I get the exact same error even running ONE of those (such as: drop alias qtemp.zz1 ; ) if I include the semicolon.
The bottom line appears to be that passing a semicolon to a query engine via VBA is problematic.
semicolon-error.PNG
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks Ray.
You may wish to look at the difference between "atomic" & "non-atomic" Compound Dynamic SQL Statements, if you are going with the "BEGIN...END" transaction-based route:
[ http://www.mcpressonline.com/sql/techtip-compound-dynamic-sql-statements.html ]
PS. You did not mention Part 2 until now, otherwise I would have suggested the approach you mentioned.
Good luck in any respect.
You may wish to look at the difference between "atomic" & "non-atomic" Compound Dynamic SQL Statements, if you are going with the "BEGIN...END" transaction-based route:
[ http://www.mcpressonline.com/sql/techtip-compound-dynamic-sql-statements.html ]
PS. You did not mention Part 2 until now, otherwise I would have suggested the approach you mentioned.
Good luck in any respect.
ASKER
Fanpages, I didn't know about part 2 'til after I conquered part 1 :-)
ASKER
Solved it with some intra-company help.