<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Read a flowfile with groovy error in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Read-a-flowfile-with-groovy-error/m-p/233766#M195589</link>
    <description>&lt;P&gt;Looks like you are referring to the script provided in &lt;A href="https://stackoverflow.com/questions/49053901/create-a-postgresql-table-from-avro-schema-in-nifi" target="_blank"&gt;this SO post&lt;/A&gt;. The variable createTable is a GString, not a Java String. This causes invocation of &lt;A href="http://docs.groovy-lang.org/docs/latest/html/api/groovy/sql/Sql.html#execute-groovy.lang.GString-" target="_blank"&gt;Sql.execute(GString)&lt;/A&gt;, which converts the embedded expressions into parameters, and you can't use a parameter for a table name. Use the following instead:&lt;/P&gt;&lt;OL&gt;
&lt;/OL&gt;&lt;PRE&gt;SQL.mydb.execute(createTable.toString())&lt;/PRE&gt;&lt;P&gt;This will cause the invocation of &lt;A href="http://docs.groovy-lang.org/docs/latest/html/api/groovy/sql/Sql.html#execute-java.lang.String-" target="_blank"&gt;Sql.execute(String)&lt;/A&gt;, which does not try to parameterize the statement.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 00:03:54 GMT</pubDate>
    <dc:creator>mburgess</dc:creator>
    <dc:date>2018-03-06T00:03:54Z</dc:date>
  </channel>
</rss>

