SQL Templates: "Duplicate local variable tempSQLSentence_tSQLTemplate"

Six Stars

SQL Templates: "Duplicate local variable tempSQLSentence_tSQLTemplate"

Hi,
I'm setting up an SQL Template with many sql statements.
Unfortunately all these sql statements generate the same java variable, as you can see below:
String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE format('SELECT set_config(%L, %L, %L)',...";
...
String tempSQLSentence_tSQLTemplate_1_1 = "WITH parent_info AS ( SELECT c.oid ...";
...
String tempSQLSentence_tSQLTemplate_1_1 = "FOR v_row IN WITH child_info AS ...";
...
and I get the error "Duplicate local variable tempSQLSentence_tSQLTemplate" many times.
Is it a bug or I strictly need to fill any SQL Template with just ONE sql statement?
More, I notice that FOR statements, as far as IF, LOOP statements, are splitted in the generated code:
...
String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE v_sql";
globalMap.put("tSQLTemplate_1_QUERY",
tempSQLSentence_tSQLTemplate_1_1);
stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1);
String tempSQLSentence_tSQLTemplate_1_1 = "END IF";
globalMap.put("tSQLTemplate_1_QUERY",
tempSQLSentence_tSQLTemplate_1_1);
stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1);
String tempSQLSentence_tSQLTemplate_1_1 = "END LOOP"; 
...
is it correct? it seems to me quite strange even once the above problem (the name duplication) is solved.
Looking forward for your help,
thank you,
Lorenzo
Moderator

Re: SQL Templates: "Duplicate local variable tempSQLSentence_tSQLTemplate"

Hi,
On which build version you got this issue? Have you tried to switched from "Designer" to "Code" tab to see if there is any error line in generated java code?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.