All Forums Analytics
24 Nov 2009
Passing column name as parameter to the prepared statemnt

[font=Tahoma]Hi ,I am trying to pass the format like 'DDMMYYYY' as parameter to the prepared statement from Java .SELECT (created_date(TIMESTAMP, FORMAT ?) (VARCHAR(10))) from tableAI get the following error .com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 13.00.00.07] [Error 3707] [SQLState 42000] Syntax error, expected something like a string or a Unicode character literal between the 'FORMAT' keyword and '?'.Any Help on is appreciated .Regards.[font=Arial][/font][/font]

Aaron01 6 posts Joined 10/09
26 Nov 2009

Construct your SQL statement from inside the SP and use EXEC command to run it. Suppose you have parameters @ColumnName, @TableName and @number, the SP is like this:_________

PCPaul 4 posts Joined 03/08
14 Dec 2009

Hi,sel cast(cast(current_timestamp(0) as char(10)) as date format 'yyyy/mm/dd');sel cast(cast(columnname as char(10)) as date format 'yyyy/mm/dd'); Try this it may help you.....Chandra Paul

You must sign in to leave a comment.