You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by to...@db.apache.org on 2004/04/15 22:14:09 UTC

[DB Torque Wiki] New: HarderTorqueFaq

   Date: 2004-04-15T13:14:07
   Editor: 217.85.255.245 <>
   Wiki: DB Torque Wiki
   Page: HarderTorqueFaq
   URL: http://wiki.apache.org/db-torque/HarderTorqueFaq

   no comment

New Page:

= FAQ for Harder Cases =

== How can I create DB-Schemes where Tables contain a Primary-Key with more than one column? ==

For Example:
[[[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database SYSTEM "D:\JAVA\database_3_1.dtd">
<database defaultIdMethod="native" name="survey_db">
	<table name="survey_system">
		<column name="systemid" type="INTEGER" description="unique SystemID" required="true" autoIncrement="true" primaryKey="true"/>
		<column name="systemname" type="CHAR" size="15"/>
		<column name="systemdesc" type="CHAR" size="255"/>
	</table>
	<table name="survey">
		<column name="systemid" type="INTEGER" description="unique SystemID" required="true" primaryKey="true"/>
		<column name="surveyid" type="INTEGER" description="unique id of a survey" required="true" autoIncrement="true" primaryKey="true"/>
		<column name="surveyname" type="CHAR" size="15" description="short name of a survey"/>
		<column name="surveydesc" type="CHAR" size="255" description="long description of the survey"/>
		<column name="surveystart" type="DATE" description="startdate of the survey"/>
		<column name="surveyend" type="DATE" description="enddate of the survey. After this date no more results can be inserted"/>
		<column name="surveystate" type="CHAR" description="state of the survey. for example open / closed / ready"/>
		<foreign-key foreignTable="survey_system" name="system2survey">
			<reference local="systemid" foreign="systemid"/>
		</foreign-key>
	</table>
</database>]]]

If try to insert a Survey you will get an Error. So... What to do?!?

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org