I have been frustrated today with what seems to be a simple problem, but I cannot get it to work; perhaps someone here knows the solution:
I am reading from DB/2 using the ODBC stage. I have specified a "table" load and it is working as I expected. Since this is a large (17 million row) daabase on the host I wanted to limit the number of rows and specified the "where clause" as a parameter.
Now when I run the job whenever I have a non-empty value in the where clause I get aborts, the first message in the log is a "main_program: Could not check all operators because of previous error(s)" and then it gives me lots of warnings about missing operators for all the columns.
I've tried several different syntaxes for this line:
WHERE IDYEAR = '2002'
IDYEAR = '2002'
Schema.IDYEAR = '2002'
SELECT * FROM Schema.Table WHERE Schema.IDYEAR = '2002'
and can't seem to get a result or a meaningful error message. The generated code doesn't help either, it doesn't put the parameter into a meaningful select.
DB/2 Table Load, using "WHERE" clause
Moderators: chulett, rschirm, roy
DB/2 Table Load, using "WHERE" clause
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I found it, should have figured it out right away.
The quotes in the WHERE clause need to be escaped, i.e.
IDYEAR = \'2002\'
and then it worked!
The quotes in the WHERE clause need to be escaped, i.e.
IDYEAR = \'2002\'
and then it worked!
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Ray,
I just kept plugging away at the problem, once I tried changing the quotes between single and double ones I was on the right track.
I just kept plugging away at the problem, once I tried changing the quotes between single and double ones I was on the right track.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Hi
ArndW are you sure that the quote is the real problem if so
Is it the issue with ODBC stage only.
We have been using ' in many of my of our jobs in DB2 Stages and they work fine.
In any case ' should not be a problem because in the query we are not expecting Data Stage to interpret the ' as part of value but take the value between the ' characters.
ArndW are you sure that the quote is the real problem if so
Is it the issue with ODBC stage only.
We have been using ' in many of my of our jobs in DB2 Stages and they work fine.
In any case ' should not be a problem because in the query we are not expecting Data Stage to interpret the ' as part of value but take the value between the ' characters.
Happy DataStaging
dsxdev,
I am sure that the quotes need to be escaped when you use a parameter in the "where" column; if you type the values in directly they need not be.
-Arnd.
I am sure that the quotes need to be escaped when you use a parameter in the "where" column; if you type the values in directly they need not be.
-Arnd.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>