Page 1 of 1

uv commands failing????

Posted: Thu Aug 19, 2004 12:50 pm
by ferreirahe
Hi,

I have this command and the respective result:

>SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS;
No... DS_JOBS... Category............ Job name............

1357 LDWE32AE ODS_EVT LDWE32AE
\\\ODS_MKT ODS_MKT_UPDATE \\\ODS_MKT_UPDATE
_UPDATE
1298 LDWE81AD ODS_EVT LDWE81AD
255 LRDJ11 ODS_FIN LRDJ11
1092 LTIPCB ODS_MKT_LOAD LTIPCB
1093 LTIPCBPRE ODS_MKT_LOAD LTIPCBPRE

However, if I query the uv with the following restriction...

>SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS WHERE JOBNO=255;
DataStage/SQL: character and number types are incompatible in this operation
Scanned command was FROM DS_JOBS SELECT JOBNO , @ID , CATEGORY , NAME WHERE JOBNO = 255 ;
>

Why is it happening? The command seems alright to me...and it does not work between quotes or double quotes (i mean the 255), also. Any ideas?

Thanks,
Henrique

Posted: Thu Aug 19, 2004 1:17 pm
by chulett
You need to use single quotes around the job number.

Re: uv commands failing????

Posted: Thu Aug 19, 2004 4:37 pm
by sumitgulati
Hi Henrique,

I do not know why single quotes are not working for you. I tried running the following command and it works perfectly fine for me:

Code: Select all

SELECT JOBNO, @ID, CATEGORY, NAME FROM DS_JOBS WHERE JOBNO='255';
Are you putting quotes at right place. Is the command you are trying to run any different from the one above.

Regards,
Sumit

Posted: Thu Aug 19, 2004 4:49 pm
by ray.wurlod
For various reasons to do with the inner workings of DataStage, JOBNO is not a numeric column. Therefore, it must be quoted in the WHERE clause.

Posted: Fri Aug 20, 2004 3:27 am
by ferreirahe
Hi guys,

It might sound stupid to you but my keyboard lost its configuration and instead of writing ' ' it was writing ` `, and I didn't notice because it was late and I was tired and...I might need to change glasses ;-)...fortunately I am going on holidays today...I need to rest...uuufff!!! Barcelona, here I go...!!!

Anyways, thanks to you all, I stopped for a while, did a little rethinking and got the bug (MY BUG!!!)

Thanks & cheers,
Henrique

Posted: Fri Aug 20, 2004 4:58 am
by ray.wurlod
This - or something quite like it - can also happen when you construct queries in something like Microsoft Word when it has the "replace straight quotes with smart quotes" enabled. :roll:

Posted: Fri Aug 20, 2004 6:01 am
by kduke
That is okay, in Texas we have the three R's, readin, rightin and rithmatic.