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
Error while selecting column form a hash file
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 130
- Joined: Mon Sep 06, 2004 3:05 am
- Location: Dubai,UAE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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".
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;
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.