Re: how to get datatype of columns of a table in perl script



On 4/14/05, Darren Duncan <darren@xxxxxxxxxxxxxxxx> wrote:
> 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
>
> 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.

Assuming you have a group of rcds called tth;

$nbrFlds = $tth->{NUM_OF_FIELDS}; ### returns the # of fields
for ($ixx=0; $ixx < $nbrFlds ; $ixx++) {
$xname = $tth->{NAME}->[$ixx]; ### returns the field name
}

Caveat,
This might be dependent on the drivers you use;
But I know this code works for Access.

HTH-
kevdot
.



Relevant Pages

  • Re: public DST patches for 10g?
    ... Oracle Database 10g Release 2 for Solaris Operating ... Even Microsoft realized that unpatched vulnerable software is ... critical bugs regardless... ... though I wouldn't mind them opening patch sets as ...
    (comp.databases.oracle.server)
  • Re: how to get datatype of columns of a table in perl script
    ... I am developing perl script which connects to oracle database and selects rows from a table and then inserts them into its corresponding table in db2. ... Any database should be able to handle this regardless of the data type. ... A great introspection feature. ...
    (perl.dbi.users)
  • date_format
    ... I have some data in an oracle database which has a data type of DATE and the ... work with an Oracle thin client. ... there a standard date setting you can change so everything outputs with the ...
    (alt.php)
  • MS Access to Oracle via ODBC
    ... All is fine until I access a particular field whose data type is described in the linked Oracle table as Memo. ... My query includes other Memo fields but they are extracted correctly. ... When the problem memo field is queried I get an error message: ... Any idea if there is a problem with the data or is it my means of accessing the Oracle Database? ...
    (microsoft.public.data.odbc)
  • RE: Errors while inserting into long data type
    ... > Hi Friends, ... > I am using oracle database and I have column of long data type. ... Ronald ...
    (perl.dbi.users)