Varchar2 Oracle problem

View: New views
3 Messages — Rating Filter:   Alert me  

Varchar2 Oracle problem

by paolo di tommaso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

I'm experiencing a strange problem with my changelog with Oracle.


I've added a simple <createTable /> element specific VARCHAR2 as type for some columns but in the generated SQL I get always VARCHAR (instead VARCHAR2) in the generated SQL.

For example:

         <createTable tableName="COIN_BUDGET_EXP_DATA" >
             <column name="BUDGET_TYPE" type="VARCHAR2(1)" ></column>
             <column name="INTERNAL_FUND_IDENTIFIER" type="NUMBER"  > <constraints  nullable="false" /> </column>
             <column name="MAJOR_PROGRAM" type="VARCHAR2(50)" ></column>
             <column name="ACTIVITY_IDENTIFIER" type="NUMBER" ></column>
             <column name="SUMMARY_ACCOUNT" type="VARCHAR2(60)" ></column>
             <column name="BUDGET_ACCOUNT" type="VARCHAR2(60)" ></column>
             <column name="EXPENDITURE_AMOUNT" type="NUMBER" ></column>
            
             <column name="LAST_UPDATE_BY" type="VARCHAR2(30)" > <constraints nullable="false" /> </column>
             <column name="LAST_UPDATE_DATE" type="DATE" > <constraints nullable="false" /> </column>
             <column name="CREATED_BY" type="VARCHAR2(30)"> <constraints nullable="false" /> </column>
             <column name="CREATION_DATE" type="DATE"> <constraints nullable="false" /> </column>
         </createTable>

Produce the folling sql code:

CREATE TABLE FAO_COIN.COIN_BUDGET_EXP_DATA (
    BUDGET_TYPE VARCHAR(1),
    INTERNAL_FUND_IDENTIFIER NUMBER NOT NULL,
    MAJOR_PROGRAM VARCHAR(50),
    ACTIVITY_IDENTIFIER NUMBER,
    SUMMARY_ACCOUNT VARCHAR(60),
    BUDGET_ACCOUNT VARCHAR(60),
    EXPENDITURE_AMOUNT NUMBER,
    LAST_UPDATE_BY VARCHAR(30) NOT NULL,
    LAST_UPDATE_DATE DATE NOT NULL,
    CREATED_BY VARCHAR(30) NOT NULL,
    CREATION_DATE DATE NOT NULL
);


Is there a specific way to get the exact oracle column type? Am I missing something?

Thank you,

-- Paolo


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-user mailing list
Liquibase-user@...
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Re: Varchar2 Oracle problem

by Voxland, Nathan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There was code in the 1.7 release to convert varchar2 in oracle to varchar in an attempt to keep things more database-independent.  It's been taken out (if I remember correct) of trunk, but not yet released.
 
For now, switching to using the <sql> tag is probably best.
 
Nathan

________________________________

From: liquibase-user-bounces@... on behalf of Paolo Di Tommaso
Sent: Wed 7/9/2008 10:22 AM
To: liquibase-user@...
Subject: [Liquibase-user] Varchar2 Oracle problem


Dear all,

I'm experiencing a strange problem with my changelog with Oracle.


I've added a simple <createTable /> element specific VARCHAR2 as type for some columns but in the generated SQL I get always VARCHAR (instead VARCHAR2) in the generated SQL.

For example:

         <createTable tableName="COIN_BUDGET_EXP_DATA" >
             <column name="BUDGET_TYPE" type="VARCHAR2(1)" ></column>
             <column name="INTERNAL_FUND_IDENTIFIER" type="NUMBER"  > <constraints  nullable="false" /> </column>
             <column name="MAJOR_PROGRAM" type="VARCHAR2(50)" ></column>
             <column name="ACTIVITY_IDENTIFIER" type="NUMBER" ></column>
             <column name="SUMMARY_ACCOUNT" type="VARCHAR2(60)" ></column>
             <column name="BUDGET_ACCOUNT" type="VARCHAR2(60)" ></column>
             <column name="EXPENDITURE_AMOUNT" type="NUMBER" ></column>
             
             <column name="LAST_UPDATE_BY" type="VARCHAR2(30)" > <constraints nullable="false" /> </column>
             <column name="LAST_UPDATE_DATE" type="DATE" > <constraints nullable="false" /> </column>
             <column name="CREATED_BY" type="VARCHAR2(30)"> <constraints nullable="false" /> </column>
             <column name="CREATION_DATE" type="DATE"> <constraints nullable="false" /> </column>
         </createTable>

Produce the folling sql code:

CREATE TABLE FAO_COIN.COIN_BUDGET_EXP_DATA (
    BUDGET_TYPE VARCHAR(1),
    INTERNAL_FUND_IDENTIFIER NUMBER NOT NULL,
    MAJOR_PROGRAM VARCHAR(50),
    ACTIVITY_IDENTIFIER NUMBER,
    SUMMARY_ACCOUNT VARCHAR(60),
    BUDGET_ACCOUNT VARCHAR(60),
    EXPENDITURE_AMOUNT NUMBER,
    LAST_UPDATE_BY VARCHAR(30) NOT NULL,
    LAST_UPDATE_DATE DATE NOT NULL,
    CREATED_BY VARCHAR(30) NOT NULL,
    CREATION_DATE DATE NOT NULL
);


Is there a specific way to get the exact oracle column type? Am I missing something?

Thank you,

-- Paolo




-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-user mailing list
Liquibase-user@...
https://lists.sourceforge.net/lists/listinfo/liquibase-user

winmail.dat (9K) Download Attachment

Re: Varchar2 Oracle problem

by paolo di tommaso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

But varchar is deprecated in Oracle. varchar2 should not change on Oracle, but converted to varchar using db from other vendor .. (at least I suppose that).

Anyway thanks for your workaround.


-- Paolo

On Thu, Jul 10, 2008 at 12:40 AM, Voxland, Nathan <nvoxland@...> wrote:
There was code in the 1.7 release to convert varchar2 in oracle to varchar in an attempt to keep things more database-independent.  It's been taken out (if I remember correct) of trunk, but not yet released.

For now, switching to using the <sql> tag is probably best.

Nathan

________________________________

From: liquibase-user-bounces@... on behalf of Paolo Di Tommaso
Sent: Wed 7/9/2008 10:22 AM
To: liquibase-user@...
Subject: [Liquibase-user] Varchar2 Oracle problem


Dear all,

I'm experiencing a strange problem with my changelog with Oracle.


I've added a simple <createTable /> element specific VARCHAR2 as type for some columns but in the generated SQL I get always VARCHAR (instead VARCHAR2) in the generated SQL.

For example:

        <createTable tableName="COIN_BUDGET_EXP_DATA" >
            <column name="BUDGET_TYPE" type="VARCHAR2(1)" ></column>
            <column name="INTERNAL_FUND_IDENTIFIER" type="NUMBER"  > <constraints  nullable="false" /> </column>
            <column name="MAJOR_PROGRAM" type="VARCHAR2(50)" ></column>
            <column name="ACTIVITY_IDENTIFIER" type="NUMBER" ></column>
            <column name="SUMMARY_ACCOUNT" type="VARCHAR2(60)" ></column>
            <column name="BUDGET_ACCOUNT" type="VARCHAR2(60)" ></column>
            <column name="EXPENDITURE_AMOUNT" type="NUMBER" ></column>

            <column name="LAST_UPDATE_BY" type="VARCHAR2(30)" > <constraints nullable="false" /> </column>
            <column name="LAST_UPDATE_DATE" type="DATE" > <constraints nullable="false" /> </column>
            <column name="CREATED_BY" type="VARCHAR2(30)"> <constraints nullable="false" /> </column>
            <column name="CREATION_DATE" type="DATE"> <constraints nullable="false" /> </column>
        </createTable>

Produce the folling sql code:

CREATE TABLE FAO_COIN.COIN_BUDGET_EXP_DATA (
   BUDGET_TYPE VARCHAR(1),
   INTERNAL_FUND_IDENTIFIER NUMBER NOT NULL,
   MAJOR_PROGRAM VARCHAR(50),
   ACTIVITY_IDENTIFIER NUMBER,
   SUMMARY_ACCOUNT VARCHAR(60),
   BUDGET_ACCOUNT VARCHAR(60),
   EXPENDITURE_AMOUNT NUMBER,
   LAST_UPDATE_BY VARCHAR(30) NOT NULL,
   LAST_UPDATE_DATE DATE NOT NULL,
   CREATED_BY VARCHAR(30) NOT NULL,
   CREATION_DATE DATE NOT NULL
);


Is there a specific way to get the exact oracle column type? Am I missing something?

Thank you,

-- Paolo



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-user mailing list
Liquibase-user@...
https://lists.sourceforge.net/lists/listinfo/liquibase-user



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Liquibase-user mailing list
Liquibase-user@...
https://lists.sourceforge.net/lists/listinfo/liquibase-user