Book a Demo

Author Topic: How to decide if a DB datatype is numeric?  (Read 2924 times)

chrvi

  • EA User
  • **
  • Posts: 75
  • Karma: +0/-0
  • There are so many hidden features...
    • View Profile
How to decide if a DB datatype is numeric?
« on: June 28, 2007, 10:30:33 am »
Hi,

I'd like to read information on Database datatypes from EA via Automation (and write new datatypes in).

Is there a simple way (probably an attribute of the given datatype) of deciding whether the datatype is numeric (and thus work with precisions) or alphabetic (such as "varchar" etc.) and work with its length?

Displaying a database datatype in EA (via Settings / Database Datatypes) will often show the maximal set length or precision info, so there is probably a flag denoting the datatype to be numeric, string or something else (such as boolean,...)
« Last Edit: June 28, 2007, 10:31:39 am by chrvi »
Radek

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to decide if a DB datatype is numeric?
« Reply #1 on: June 28, 2007, 11:45:41 am »
Hi Radek,

Take a look at the t_datatypes table in the EA schema. You can do this via MS Access - just open any EAP file. Or, you can read one of the SQL scripts Sparx provided on their Resources page for setting up a DBMS.

I don't know if you can get this stuff directly. If not you could do one of two things. Either read the output produced when you Export Reference Data, or link to the back end database through OLE DB (or whatever you fancy) and read the above table.

David
No, you can't have it!