문제

I want to send a query to different tables. I want to take the table name as the parameter so I used "?" but it gives an error when I invoke it. If I write the table name instead of "?" without any parameters, there is no error. Can you guys suggest a solution? Thanks.

var selectStatement = WL.Server.createSQLStatement("select * from ?");
function getStudentInfos(param1) {    

    return WL.Server.invokeSQLStatement({
        preparedStatement : selectStatement,
        parameters : [param1]
    });
}
도움이 되었습니까?

해결책

There is no way to take the table name as a parameter in a static sql query. The only way to do this is to create the sql query dynamically. Take a look here: Table name as variable

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top