Informix 12.10 Finding the error point in the query when the statement could not be “prepare ”d from the query

拥有回忆 提交于 2021-02-11 15:09:58

问题


I have long query like this in the procedure

 CREATE PROCEDURE procedure1(var type1)
 DEFINE Result   Type2;
 LET c_query =
 "SELECT "      || 
 "RESULT "      || 
 "FROM "        ||
 "QUERY_PART1 " ||
 "join "        ||
 "QUERY_PART2 " ||
 "join "        ||
 ...
 "END_PART ";

 PREPARE c_stmt FROM c_query; --  Problematic line

 DECLARE c_cur CURSOR FOR c_stmt;
 OPEN c_cur;
 ....
 END  PROCEDURE

But the "PREPARE c_stmt FROM c_query;" line does not run , and the error is

Execute: A syntax error has occurred

I Try to find syntax error of Query, online, but didn't work. Can I find the line of Error?

Can anybody Help?

来源:https://stackoverflow.com/questions/64746385/informix-12-10-finding-the-error-point-in-the-query-when-the-statement-could-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!