Put debug statements in Torque's DBOracle adaptor:

    public String getIDMethodSQL(Object sequenceName)
    {
String sequenceString = "select " + sequenceName + ".nextval from dual";
System.out.println("****************************************************
***********");
System.out.println("sequence string = [" + sequenceString + "]");
System.out.println("****************************************************
***********");

        return ("select " + sequenceName + ".nextval from dual");
    }

Printed:

***************************************************************
sequence string = [select null.nextval from dual]
***************************************************************
                           ^

Why is the sequenceName null?
In the SQL file Torque correctly generated:

CREATE SEQUENCE SUBSCRIBER_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE
NOCYCLE NOCACHE ORDER;


> -----Original Message-----
> From: David Sean Taylor [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, April 30, 2002 7:23 PM
> To: 'Turbine Torque Users List'
> Subject: Oracle -- failing to generate sequence
> 
> 
> I get the stack trace when adding new records on Oracle:
> Anyone seen this before....
> 
> <database defaultJavaType="object" defaultIdMethod="native"> 
> ... <table name="SUBSCRIBER">
> 
>       <column name="SUBSCRIBER_ID"    
>                         type="INTEGER"
>                         primaryKey="true"
>                         autoIncrement="true"
>                         required="true"/>
> ....
> 
> org.apache.torque.TorqueException: ORA-00923: FROM keyword 
> not found where expected
>       at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:885)
>       at
> com.test.om.BaseSubscriberPeer.doInsert(BaseSubscriberPeer.java:279)
>       at
> com.test.om.BaseSubscriberPeer.doInsert(BaseSubscriberPeer.java:677)
>       at com.test.om.BaseSubscriber.save(BaseSubscriber.java:2196)
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-torque-user-> [EMAIL PROTECTED]>
> 
> For additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to