<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.idempiere.org/w-en/index.php?action=history&amp;feed=atom&amp;title=SQL_Convention</id>
	<title>SQL Convention - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.idempiere.org/w-en/index.php?action=history&amp;feed=atom&amp;title=SQL_Convention"/>
	<link rel="alternate" type="text/html" href="https://wiki.idempiere.org/w-en/index.php?title=SQL_Convention&amp;action=history"/>
	<updated>2026-10-01T10:03:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.idempiere.org/w-en/index.php?title=SQL_Convention&amp;diff=21854&amp;oldid=prev</id>
		<title>Hieplq: Note about convention of sql to pass parse</title>
		<link rel="alternate" type="text/html" href="https://wiki.idempiere.org/w-en/index.php?title=SQL_Convention&amp;diff=21854&amp;oldid=prev"/>
		<updated>2023-12-06T17:44:25Z</updated>

		<summary type="html">&lt;p&gt;Note about convention of sql to pass parse&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;SQL use on idempiere need to follow some strict rule to pass internal parse [https://mattermost.idempiere.org/idempiere/pl/pjdwg9kwsfrwxqrg5nnguwk8ny sql parse discuss on mattermost]&lt;br /&gt;
&lt;br /&gt;
sql can come from somewhere as virtual column,...&lt;br /&gt;
&lt;br /&gt;
==== 1. ON clause need to input condition on &amp;quot;()&amp;quot; ====&lt;br /&gt;
    FROM tabel1 tb1 JOIN table2 tb2 ON tb1.column1 = tb2.column1&lt;br /&gt;
    then &amp;quot;tb1.column1 = tb2.column1&amp;quot; need to inside &amp;quot;()&amp;quot;&lt;br /&gt;
&lt;br /&gt;
reference bellow code on AccessSqlParser.getTableInfo&lt;br /&gt;
    indexClose = from.lastIndexOf(')', indexNextOn);&lt;br /&gt;
&lt;br /&gt;
==== 2. Keyword should use uppercase ====&lt;br /&gt;
==== 3. no space between &amp;quot;(&amp;quot; and keyword ====&lt;br /&gt;
    Select column1, ( Select column2 FROM subTb stb) AS cl2 FROM mainTb&lt;br /&gt;
reference bellow code on AccessSqlParser.getSubSQL&lt;br /&gt;
    index = sql.indexOf(&amp;quot;(SELECT &amp;quot;, 7);&lt;/div&gt;</summary>
		<author><name>Hieplq</name></author>
	</entry>
</feed>