Book a Demo

Author Topic: Problem while transforming strings to varchar!!!  (Read 2206 times)

rubenrcu

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem while transforming strings to varchar!!!
« on: May 24, 2007, 06:07:09 am »
Hi, I created an Abstract Class Model (PIM), then I transformed it to a DDL PSM, and it work well, except for the classes in the PIM with Strings attributes it convert it in to TEXT in the PSM, my default database datatypes is SQL Server 2000, and I need theses fields as VARCHAR.
Thanks
« Last Edit: May 24, 2007, 07:32:36 am by rubenrcu »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem while transforming strings to varchar!
« Reply #1 on: May 24, 2007, 03:08:20 pm »
Both VARCHAR and TEXT correspond to the abstract type of string, so there isn't anything for EA distinguish between them, so it just chooses one.

If you want more control over the type generated you'll have to modify the transform templates to override the behaviour of CONVERT_TYPE.

Something like the following is a decent start.

Code: [Select]
%if attType=="string"%
%if attTag:"longstring" == "true"%
 type=%qt%TEXT%qt%
%else%
 type=%qt%VARCHAR%qt%
%if attTag:"length" != ""%
 length=%qt%%attTag:"length"%%qt%
%endIf%
%endIf%
%else%
 type=%qt%%CONVERT_TYPE(genOptDefaultDatabase,attType)%%qt%
%endIf%

Of course this is now encoding database specific information it depends on what you want.  That's why it's not in the provided DDL templates.

PS. You don't need to post the same question four times to get a response.

rubenrcu

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem while transforming strings to varchar!
« Reply #2 on: May 24, 2007, 03:52:15 pm »
Thank a lot for your answer and apology for open n threads with the same question!!  
I transformed the class model to and Oracle DB, and after that I converted to and SQL Server DB, but I done it table by table, Is there any way to convert all the tables in the DLL package from one DB to another.
Once again Thanks