src-wad/src/org/openbravo/wad/Fields_data.xsql
changeset 1239 e5124b398f64
parent 1096 916279c46d84
child 1605 8a0fe0193bef
equal deleted inserted replaced
1238:50275bb5700b 1239:e5124b398f64
   365       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   365       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   366       <Sql>
   366       <Sql>
   367         SELECT MAX(columnname) AS NAME FROM AD_COLUMN, AD_TABLE 
   367         SELECT MAX(columnname) AS NAME FROM AD_COLUMN, AD_TABLE 
   368         WHERE AD_TABLE.NAME = ?
   368         WHERE AD_TABLE.NAME = ?
   369           AND AD_COLUMN.ad_table_id = AD_TABLE.ad_table_id
   369           AND AD_COLUMN.ad_table_id = AD_TABLE.ad_table_id
   370           AND isidentifier = 'Y' AND SeqNo = (CASE TO_CHAR(AD_TABLE.NAME) WHEN 'C_PaySelectionCheck' THEN 2 ELSE 1 END)
   370           AND isidentifier = 'Y' 
       
   371           AND SeqNo = (CASE TO_CHAR(AD_TABLE.NAME) 
       
   372                           WHEN 'C_PaySelectionCheck' THEN 2 
       
   373                           ELSE (SELECT MIN(SeqNo) 
       
   374                                   FROM AD_Column 
       
   375                                  WHERE AD_Table_ID=AD_TABLE.AD_Table_ID 
       
   376                                    AND IsIdentifier='Y')
       
   377                            END)
   371       </Sql>
   378       </Sql>
   372       <Parameter name="tableName"/>
   379       <Parameter name="tableName"/>
   373   </SqlMethod>
   380   </SqlMethod>
   374   <SqlMethod name="identifierColumns" type="preparedStatement" return="multiple">
   381   <SqlMethod name="identifierColumns" type="preparedStatement" return="multiple">
   375       <SqlMethodComment>identifier columns of a table</SqlMethodComment>
   382       <SqlMethodComment>identifier columns of a table</SqlMethodComment>