Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Teradata Syntax Trouble - response (2) by smart351

$
0
0

Oh thank hyou for your response! I didn't get an email so I didn't think I had one. :)
 
START_Y is DATE. It displays as 2012-03-26. However, the syntax above (START_Y <= DATE '2012-03-26') has been tried and fails. :( It works in SQL Assistant, but I am querying from IBM BPMv8 tool directly against the Teradata database through a JDBC connection and that syntax does not work. From what I have found in my research/testing, syntax between SQL Assistant against a Teradata DB and syntax directly toward the Teradata DB (BTEQ) does not match. Below is an example of it not matching:
This code works in SQL Assistant:
Select EDWC076_RATE_TYPE_N
From EDWDEV_VIEW.EDWC075_USD_EXCH_RATE_VW
Where EDWC076_RATE_TYPE_N like 'TREND%' and YEAR(EDWC075_EFF_OUT_Y)=2013
 
However if you run it directly against Teradata (BTEQ), it gives me that Connection Closed Error. So I researched and found that the correct syntax had to be changed to:
  Select EDWC076_RATE_TYPE_N
  From EDWDEV_VIEW.EDWC075_USD_EXCH_RATE_VWWhere EDWC076_RATE_TYPE_N like 'TREND%' and EXTRACT(YEAR from (EDWC075_EFF_OUT_Y))=2013
 
Notice the difference between using YEAR() in SQL Assistant and having to use EXTRACT(YEAR from ()) when going against the DB using BTEQ.
 
Thank you!


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>