
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use Talend Keyword in select Query
Hello All,
Hope you are doing good,
I have been facing some problem while querying my table from tDBInput component,
Actually my table has the Column name as "DATETIME" when i try to query (Select DATETIME from tablename) the table, i was getting the error like java.sql.SQLSyntaxErrorException: ORA-00936: missing expression. Is there any possibilities to escape the/use talend keyword in query?
"SELECT
"+context.DB_Schema+".MYTABLE.\"DATETIME \"
FROM "+context.DB_Schema+".MYTABLE"
then I tried below( this also getting error)
"SELECT
"+"\"DATETIME\""+" FROM MYTABLE"
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I agree with TRF. DATETIME is a reserved keyword and ideally we should not use these keywords while creating column names. Please refer the Oracle documentation below.
The right approach will be to choose another name for your column which will not conflict with keyword settings.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I agree with TRF. DATETIME is a reserved keyword and ideally we should not use these keywords while creating column names. Please refer the Oracle documentation below.
The right approach will be to choose another name for your column which will not conflict with keyword settings.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you,
Without changing the column name in the table(Should not change), Need to handle this inside the tDbInput component. Can anybody help on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vignesh,
Its an Oracle DB error. Could you please check whether the query is working from SQL Prompt or Oracle SQL Assistant?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes the query is perfectly working sql prompt.
Select DATETIME from tablename;
listing the result correctly.
