Re: SQL TYPE MAP such as SQL_CHAR, SQL_NUMERIC , etc

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Ragnar <gnari(at)hive(dot)is>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL TYPE MAP such as SQL_CHAR, SQL_NUMERIC , etc
Date: 2006-02-23 21:31:14
Message-ID: 43FE29A2.2010407@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>Maybe it is us that need some clues from you.
>
>

We use perl DBI to read table names, column names, and column types from
Oracle rdb 7.3 through ODBC, and then try to create tables into postgresql.

Through perl DBI, we got:

Column Name Type Precision Scale Nullable?
------------------------------ ---- --------- ----- ---------

col1 1 4 0 Yes
col2 1 4 0 Yes
col3 1 2 0 Yes
col4 4 11 0 Yes
col5 3 4 2 Yes
col6 93 13 0 Yes
...
...

I'd like to know how to map the integer type value "1, 3, 4, 93, etc" to
SQL_type?

>
>
>>
>>
>>
>>>May I know where I can find some online documents about mapping the
>>>integer values to the following SQL types please?
>>>
>>>For example, if I have value 1 , so that I know 1 is mapped to
>>>SQL_CHAR; if I have value 3, so that I know 3 is mapped to SQL_NUMERIC.
>>>
>>>
>>> Data Types
>>>
>>> The following data types are supported:
>>>
>>> SQL_CHAR
>>>
>>> SQL_VARCHAR
>>>
>>> SQL_LONGVARCHAR
>>>
>>> SQL_NUMERIC
>>>
>>> SQL_DECIMAL
>>>
>>> SQL_SMALLINT
>>>
>>> SQL_INTEGER
>>>
>>> SQL_REAL
>>>
>>> SQL_FLOAT
>>>
>>> SQL_DOUBLE
>>>
>>> SQL_BIT
>>>
>>> SQL_TINYINT
>>>
>>> SQL_BIGINT
>>>
>>> SQL_BINARY
>>>
>>> SQL_VARBINARY
>>>
>>> SQL_LONGVARBINARY
>>>
>>> SQL_TYPE_DATE
>>>
>>> SQL_TYPE_TIME
>>>
>>> SQL_TYPE_TIMESTAMP
>>>
>>> SQL_INTERVALS (all types)
>>>
>>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>>
>>
>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-02-23 21:35:25 Re: SQL TYPE MAP such as SQL_CHAR, SQL_NUMERIC , etc
Previous Message Brandon Metcalf 2006-02-23 21:25:52 Re: subtracting minutes from date