FYI: I've forwarded this response to the turbine-torque mailing list, please use the mailing list for future queries.
--- I believe the default for auto increment is a non-native one and the db.props file for Sybase must be updated to include the IDENTITY keyword: templates/sql/base/sybase/db.props <snip> # # This is the autoincrement value if using native methods for # incrementing keys. Most likely IDENTITIY wrt Sybase ASE. # Leaving the value blank should be used when Turbine's IDBroker # is used to autoincrement keys. # # Default: [blank] # AUTOINCREMENT = IDENTITY # # If true, the NOT NULL values will not be printed in generated # SQL files if the column is set to autoincrement. Should be true # when the internal IDENTITY attribute ( above ) is used in a column # for autoincrementing keys. # # Default: false # removeNotNullWithAutoIncrement = true </snip> I hope this helps. ================================================================= Jeffrey D. Brekke Quad/Graphics [EMAIL PROTECTED] http://www.qg.com > -----Original Message----- > From: Andras Balogh [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 4:49 AM > To: [EMAIL PROTECTED] > Subject: Torque with Sybase > > > Hello, > > We have seen your name (and email) on Torque's homepage as > you were assigned > to test > torque with Sybase, and we thought you could help as with > some samples or > give us some > advice. > We are trying to use torque with sybase and it seems like it > is not working. > Here is our test schema: > <database > name="survey"> > > <table name="produse" description="Produse" idMethod="native"> > <column > name="prodid" > required="true" > primaryKey="true" > autoIncrement="true" > type="INTEGER" > description="ProdId"/> > <column > name="nume" > required="true" > type="VARCHAR" > size="255" > description="Nume"/> > <column > name="code" > required="true" > type="VARCHAR" > size="24" > description="Cod"/> > </table> > <table name="depozit" description="Depozit" idMethod="none"> > <column > name="nume" > required="true" > type="VARCHAR" > size="125" > description="NUME"/> > <column > name="strada" > required="true" > type="VARCHAR" > size="255" > description="Strada"/> > </table> > </database> > > And here is the generated sql file after running ant: > > IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name > = 'produse') > BEGIN > DROP TABLE produse > END > ; > > CREATE TABLE produse > ( > prodid INT NOT NULL, > nume VARCHAR (255) NOT NULL, > code VARCHAR (24) NOT NULL, > CONSTRAINT produse_PK PRIMARY KEY(prodid) > ); > > > > IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name > = 'depozit') > BEGIN > DROP TABLE depozit > END > ; > > CREATE TABLE depozit > ( > nume VARCHAR (125) NOT NULL, > strada VARCHAR (255) NOT NULL, > CONSTRAINT depozit_PK PRIMARY KEY() > ); > > This doesn't look ok to us because there is no autoincrement field and > sybase supports > autoincrement fields. > > After running out application: > > Depozit dep=new Depozit(); > dep.setNume("aaaa"); > dep.setStrada("sddfgv dbfb gf"); > dep.save(); > > we get an exception from sybase beacuse the generated insert > statement looks > like this: > insert into depozit ( ) values ( ) > > > We will appreciate any help from you. > > Thank you in advance, > > > Andras Balogh - programmer > http://www.reea.net > > > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
