Error while selecting column form a hash file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Error while selecting column form a hash file

Post by nkln@you »

I populated a hash file Hash_Booking with filed name A. There is only one value for column A and that value is 0.


When i went to adminstartor command and executed

select A from Hash_Booking .

It says DataStage/SQL: syntax error . Unexpected symbol . Token was "A". Scanned command was from Hash_Booking SELECT A.

But when i execute

select * from Hash_Booking ;It is showing

COUNT.......

0.0000

1 RECORDS LISTED.

I verified once again that column A is present in hash file.

But why do i get this error
Aim high
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Try renaming your column from "A" to another name, preferably one that is not a reserved DataStage keyword and see if you have the same problem.
Sunshine2323
Charter Member
Charter Member
Posts: 130
Joined: Mon Sep 06, 2004 3:05 am
Location: Dubai,UAE

Post by Sunshine2323 »

Try

select A from Hash_Booking;

Lets us know the result
Warm Regards,
Amruta Bandekar

<b>If A equals success, then the formula is: A = X + Y + Z, X is work. Y is play. Z is keep your mouth shut. </b>
--Albert Einstein
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A is a reserved word. You need to quote the column name in double quotes if it is a reserved word or contains spaces. This is known as a "delimited identifier".

Code: Select all

SELECT "A" FROM Hash_Booking;
Of course, if you want to select the literal 'A' from every column, SQL rules mandate single quotes.

Code: Select all

SELECT 'A' FROM Hash_Booking;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

Post by nkln@you »

Ray, Thanks ,

I changed the column name and also hash file name. This worked now.
Aim high
Post Reply