ktrinad Posted August 31, 2006 Share Posted August 31, 2006 By: pandu - pandu16 Error while using Parameter in SQL Query 2003-09-11 14:13 1. Defined a parameter Name: UserNm Parameter class type: java.lang.String Default value expression: new String("GSOP") and 2. Put the parameter into your query: select * from MEWTD.EWT64SN2A where LAST_CHG_USER_NM=$P!{UserNm} =================================== This is the ERRORRRRR! SQL problems: [iBM][CLI Driver] CLI0118E Invalid SQL syntax. SQLSTATE=37000 COM.ibm.db2.jdbc.DB2Exception:[iBM][CLI Driver] CLI0118E Invalid SQL syntax. SQLSTATE=37000 at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:270) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:207) at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:458) at COM.ibm.db2.jdbc.DB2Statement.execute2(DB2Statement.java:838) at COM.ibm.db2.jdbc.DB2Statement.executeQuery(DB2Statement.java:580) at iReportJDBCConnector.main(IReportJDBCConnector.java:82) CODE4 Appreciate your Help Thanks Pandu By: Gregory A. Swarthout - gswarthout RE: Error while using Parameter in SQL Query 2003-09-11 14:21 Is it the problem of not throwing quotes around value as in: select * from MEWTD.EWT64SN2A where LAST_CHG_USER_NM = '$P!{UserNm}' By: Sachin Aggarwal - sk_aggarwal RE: Error while using Parameter in SQL Query 2003-09-11 19:10 Hi, Also try using '$P{UserNm}' instead of '$P!{UserNm}'. Hope it works now Sachin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now