You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by michael shek sia lim <mi...@eigentechnology.com> on 2002/11/25 23:50:28 UTC

Sql entry

Hi,

I am trying to create a database via the TDK schema. Below is my .xml file
content:

    <table name="INVOICE">
          <column name="ID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
          <column name="INVOICENO" size="10" type="INTEGER"/>
          <column name="CUSTOMERREF" size="50" type="INTEGER"/>
            <column name="DATE" type="DATETIME"/>
            <column name="CONTACT" size="20" type="VARCHAR"/>
            <column name="PAYMENTTERM" size="20" type="VARCHAR"/>
            <column name="SUBTOTAL" type="FLOAT"/>
            <column name="GST" type="FLOAT"/>
            <column name="TOTAL" type="FLOAT"/>
            <column name="COMMENT" type="TEXT"/>
    </table>

I realize that TDK does not like "TEXT" and "DATETIME" as input for type.
These are standard SQL entries and I believe they are quite common in
usage, I would appreciate if anyone could show me how to write an
acceptable .xml file.

cheers
michael







--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Sql entry

Posted by Eric Emminger <er...@ericemminger.com>.
Michael

> There is a slight difference between VARCHAR and TEXT under MySQL, could
> be the same in other database, TEXT does not have a "size" limit under
> MySQL. Just wondering if there is a list of "LEGAL" input for the
> schema.xml?

The DTD contains this info.

http://jakarta.apache.org/turbine/dtd/database.dtd

Hope that helps!

-- 
Eric Emminger
eric@ericemminger.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Sql entry

Posted by michael shek sia lim <mi...@eigentechnology.com>.
Thanks Chris,

There is a slight difference between VARCHAR and TEXT under MySQL, could
be the same in other database, TEXT does not have a "size" limit under
MySQL. Just wondering if there is a list of "LEGAL" input for the
schema.xml?
Any help would be appreciated.

cheers
michael


> TEXT:  ...type="VARCHAR" size="20"...
> DATETIME:  ...type="TIMESTAMP"...
>
> Use the turbine-schema.xml as an example.  Also, read the documentation
> on the Torque (a sub-project of Turbine) site for more information on
> schemas, peers, and Criteria.  http://jakarta.apache.org/turbine/torque/
>
> Chris
>
>
>> -----Original Message-----
>> From: michael shek sia lim [mailto:michael@eigentechnology.com]
>> Sent: Monday, November 25, 2002 3:50 PM
>> To: turbine-user@jakarta.apache.org
>> Subject: Sql entry
>>
>>
>> Hi,
>>
>> I am trying to create a database via the TDK schema. Below is my .xml
>> file content:
>>
>>     <table name="INVOICE">
>>           <column name="ID" required="true" autoIncrement="true"
>> primaryKey="true" type="INTEGER"/>
>>           <column name="INVOICENO" size="10" type="INTEGER"/>
>>           <column name="CUSTOMERREF" size="50" type="INTEGER"/>
>>             <column name="DATE" type="DATETIME"/>
>>             <column name="CONTACT" size="20" type="VARCHAR"/>
>>             <column name="PAYMENTTERM" size="20" type="VARCHAR"/>
>> <column name="SUBTOTAL" type="FLOAT"/>
>>             <column name="GST" type="FLOAT"/>
>>             <column name="TOTAL" type="FLOAT"/>
>>             <column name="COMMENT" type="TEXT"/>
>>     </table>
>>
>> I realize that TDK does not like "TEXT" and "DATETIME" as input for
>> type. These are standard SQL entries and I believe they are quite
>> common in usage, I would appreciate if anyone could show me how to
>> write an acceptable .xml file.
>>
>> cheers
>> michael
>>
>>
>>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sql entry

Posted by Matt Koranda <ma...@orkan.no>.
I remember seeing this question a few times and I also had some problems
with this. I think the documentation is lacking a bit here and I will add to
it myself once the wiki is in place....

I solved this by using TIMESTAMP, and CLOB types......

Matt


----- Original Message -----
From: "michael shek sia lim" <mi...@eigentechnology.com>
To: <tu...@jakarta.apache.org>
Sent: Monday, November 25, 2002 11:50 PM
Subject: Sql entry


> Hi,
>
> I am trying to create a database via the TDK schema. Below is my .xml file
> content:
>
>     <table name="INVOICE">
>           <column name="ID" required="true" autoIncrement="true"
> primaryKey="true" type="INTEGER"/>
>           <column name="INVOICENO" size="10" type="INTEGER"/>
>           <column name="CUSTOMERREF" size="50" type="INTEGER"/>
>             <column name="DATE" type="DATETIME"/>
>             <column name="CONTACT" size="20" type="VARCHAR"/>
>             <column name="PAYMENTTERM" size="20" type="VARCHAR"/>
>             <column name="SUBTOTAL" type="FLOAT"/>
>             <column name="GST" type="FLOAT"/>
>             <column name="TOTAL" type="FLOAT"/>
>             <column name="COMMENT" type="TEXT"/>
>     </table>
>
> I realize that TDK does not like "TEXT" and "DATETIME" as input for type.
> These are standard SQL entries and I believe they are quite common in
> usage, I would appreciate if anyone could show me how to write an
> acceptable .xml file.
>
> cheers
> michael
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Sql entry

Posted by Chris K Chew <ch...@fenetics.com>.
TEXT:  ...type="VARCHAR" size="20"...
DATETIME:  ...type="TIMESTAMP"...

Use the turbine-schema.xml as an example.  Also, read the documentation on
the Torque (a sub-project of Turbine) site for more information on schemas,
peers, and Criteria.  http://jakarta.apache.org/turbine/torque/

Chris


> -----Original Message-----
> From: michael shek sia lim [mailto:michael@eigentechnology.com]
> Sent: Monday, November 25, 2002 3:50 PM
> To: turbine-user@jakarta.apache.org
> Subject: Sql entry
>
>
> Hi,
>
> I am trying to create a database via the TDK schema. Below is my .xml file
> content:
>
>     <table name="INVOICE">
>           <column name="ID" required="true" autoIncrement="true"
> primaryKey="true" type="INTEGER"/>
>           <column name="INVOICENO" size="10" type="INTEGER"/>
>           <column name="CUSTOMERREF" size="50" type="INTEGER"/>
>             <column name="DATE" type="DATETIME"/>
>             <column name="CONTACT" size="20" type="VARCHAR"/>
>             <column name="PAYMENTTERM" size="20" type="VARCHAR"/>
>             <column name="SUBTOTAL" type="FLOAT"/>
>             <column name="GST" type="FLOAT"/>
>             <column name="TOTAL" type="FLOAT"/>
>             <column name="COMMENT" type="TEXT"/>
>     </table>
>
> I realize that TDK does not like "TEXT" and "DATETIME" as input for type.
> These are standard SQL entries and I believe they are quite common in
> usage, I would appreciate if anyone could show me how to write an
> acceptable .xml file.
>
> cheers
> michael
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>