Re: how to get datatype of columns of a table in perl script
- From: darren@xxxxxxxxxxxxxxxx (Darren Duncan)
- Date: Thu, 14 Apr 2005 11:15:39 -0700
At 7:38 PM +0530 4/14/05, Vamsi_Doddapaneni wrote:
Hi all I am new to perl just (1 1/2 month experience.). I am developing perl script which connects to oracle database and selects rows from a (x) table and then inserts them into its corresponding table in db2. So, while inserting i need to find what is the datatype of columns , since we need to use quotes for varchar,date etc..... Could anybody help me out to find an approach . Thanks in advance Regards Vamsi
A simple generic solution is to just quote all literal values, regardless of the data type. Any database should be able to handle this regardless of the data type.
As for finding out data types, you should be able to use Oracle's support of the INFORMATION_SCHEMA feature to look it up. Eg, look for special built-in views whose names I think are 'USER_TABLES'/'ALL_TABLES', 'USER_TAB_COLS', etc, as these describe all the normal tables. A great introspection feature.
-- Darren Duncan .
- References:
- how to get datatype of columns of a table in perl script
- From: Vamsi_Doddapaneni
- how to get datatype of columns of a table in perl script
- Prev by Date: Problem inserting CLOB via stored procedure
- Next by Date: RE: how to get datatype of columns of a table in perl script
- Previous by thread: how to get datatype of columns of a table in perl script
- Next by thread: Re: how to get datatype of columns of a table in perl script
- Index(es):
Relevant Pages
|