Hi,

I am trying to create a dbforms page based on a join of two tables. I 
created a super-simple example (dbforms-config.xml):

<table name="testTable1">
<field name="keyField" fieldType="int" size="10" isKey="true"/>
<field name="fieldA1" fieldType="char" size="10" />
</table>        
<table name="testTable2">
<field name="keyField" fieldType="int" size="10" isKey="true"/>
<field name="fieldB1" fieldType="char" size="10" />
</table>

This is my JSP:

<%@ taglib uri="WEB-INF/dbforms.tld" prefix="db" %>
<html xmlns:db="http://www.wap-force.com/dbforms";>
    <head><db:base/></head>
    <body>
        <db:dbform followUp="/plan_single2.jsp" maxRows="*" 
        tableName="testTable1"  tableList="testTable1 a, testTable2 b"
        whereClause="WHERE a.keyField = b.keyField" >
            <db:body>
                    <db:textField size="5" fieldName="b.fieldB1"/>
            </db:body>
        </db:dbform>
    </body>
</html>

Whenever I try this, the debug output returns the following error:
464018 -------- [tcpConnection-80-2] INFO  org.dbforms.Table  -
 ::getFreeFormSelectQuery -- [SELECT keyField, fieldA1  FROM 
testTable1 a, testTable2 b WHERE a.keyField = b.keyField]
464028 -------- [tcpConnection-80-2] ERROR org.dbforms.util.SqlUtil  -
 ::logSqlExceptionSQL - exception
java.sql.SQLException: General error: Column: 'keyField' in field list 
is ambiguous

I tried many things, for example change the tableName attribute to 
tableName="AnyName" like the doc says, but I get a 
NullPointerException at org.dbforms.taglib.DbFormTag.setTableName
(DbFormTag.java:246) unless it's a real table name. 

I am using MySQL with dbforms 1.1.3. 

What am I missing, is there an executable example for this?

Also, is it possible to use the tableList in a sub-form?

Thanks,
alex :-)


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to