cancel
Showing results for 
Search instead for 
Did you mean: 

Passing tablename as variable in SQLJ

Former Member
0 Kudos

Hi all,

I've developed an application in WebDynpro using SQLJ.This application accesses my MAXDB database.When I write a normal query in SQLJ for e.g

INSERT into TMP_EMPLOYEE(EMPID,EMPNAME,DEPT) values (:empid,:empname,:dept)

(empid,empname,dept are variables) there is no problem.

What I want to do is replace the table name by a variable which contains the tablename.I tried the following query

INSERT into :tablename (EMPID,EMPNAME,DEPT) values (:empid,:empname,:dept)

But it gave me syntax error

<b>SQLJ: SQL syntax error: the token "?" was not expected here</b>

Has anybody tried this?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

SQLJ doesn't support dynamic sql statements. Please use OpenSQL/JDBC.