No SQL Exception importing Pack

58 views
Skip to first unread message

Filippo Cenghiaro

unread,
May 31, 2024, 11:15:21 AMMay 31
to iDempiere
Hello,
I've created a PackOut containing a SQL Statement with an update query but when I try to import the pack the update is not executed and I recieve this exception:
16:40:49.124===========> SQLStatementElementHandler.startElement: SQLStatement [318]
java.lang.IllegalArgumentException: No SQL
at org.compiere.util.DB.prepareStatement(DB.java:751)
at org.compiere.util.DB.prepareStatement(DB.java:711)
at org.adempiere.pipo2.handler.SQLStatementElementHandler.startElement(SQLStatementElementHandler.java:65)
at org.adempiere.pipo2.PackInHandler.processElement(PackInHandler.java:237)
at org.adempiere.pipo2.PackInHandler.endElement(PackInHandler.java:325)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:618)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1728)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2899)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:326)
at java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:197)
at org.adempiere.pipo2.PackIn.importXML(PackIn.java:172)
at org.adempiere.pipo2.PackIn.importXML(PackIn.java:135)
at org.adempiere.pipo2.PackInProcess.doIt(PackInProcess.java:145)
at org.compiere.process.SvrProcess.process(SvrProcess.java:256)
at org.compiere.process.SvrProcess.startProcess(SvrProcess.java:164)
For reference this is the query: UPDATE c_country SET capturesequence = (TRIM(capturesequence) || ' @L@') WHERE capturesequence NOT LIKE '%@L@%';
Does anyone know a solution?
Thank you
Filippo

Jesús Castillo

unread,
May 31, 2024, 11:17:59 AMMay 31
to idem...@googlegroups.com

 Hi,

Can you attach the pack? Maybe the sql field is empty.
Atte: Jesus Castillo.

Mailtrack Remitente notificado con
Mailtrack
31/05/24, 11:16:58

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/23f654eb-a85e-4f02-bc63-303e5f0bd4c5n%40googlegroups.com.

Filippo Cenghiaro

unread,
May 31, 2024, 11:33:02 AMMay 31
to iDempiere
Here is the pack, I,ve already checked and it doesn't seems empy.
Locode On Location.zip

Carlos Antonio Ruiz Gomez

unread,
May 31, 2024, 1:32:39 PMMay 31
to idem...@googlegroups.com
Hi Filippo, the problem must be in the @L@, the SQL parser interprets that as a context variable and tries to replace it, as the context variable L does not exist then it makes the SQL empty.

I had that problem before, and the easy workaround was to replace the @ with chr(64), something like:

UPDATE c_country SET capturesequence = (TRIM(capturesequence) || ' '||chr(64)||'L'||chr(64)||'') WHERE capturesequence NOT LIKE '%'||chr(64)||'L'||chr(64)||'%';

Regards,

Carlos Ruiz



Am 31.05.24 um 17:33 schrieb Filippo Cenghiaro:
Here is the pack, I,ve already checked and it doesn't seems empy.

Il giorno venerdì 31 maggio 2024 alle 17:17:59 UTC+2 jcas...@gmail.com ha scritto:

 Hi,

Can you attach the pack? Maybe the sql field is empty.
Atte: Jesus Castillo.


Filippo Cenghiaro

unread,
Jun 3, 2024, 2:28:51 AMJun 3
to idem...@googlegroups.com
Hi Carlos,
it works without any problems.
Thank you

--
You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/x0_xjN5jniU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/faf475c7-57a7-48d4-b0bf-859f3acb7cda%40gmail.com.
Reply all
Reply to author
Forward
0 new messages