Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
kinterbas db column type
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Uwe Grauer  
View profile  
 More options Nov 26 2003, 9:41 am
Newsgroups: comp.lang.python
From: Uwe Grauer <mailinglistsu...@onlinehome.de>
Date: Wed, 26 Nov 2003 15:41:10 +0100
Local: Wed, Nov 26 2003 9:41 am
Subject: kinterbas db column type
Hi,

i need to know the database column types returned by kinterbasdb.
Implicit type conversion is i nice thing to have, but it hides the real
types in the database.
So how could i get this information?

Thanks,
        Uwe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gandalf  
View profile  
 More options Nov 26 2003, 11:01 am
Newsgroups: comp.lang.python
From: Gandalf <gand...@geochemsource.com>
Date: Wed, 26 Nov 2003 16:24:03 +0100
Local: Wed, Nov 26 2003 10:24 am
Subject: Re: kinterbas db column type

> i need to know the database column types returned by kinterbasdb.
> Implicit type conversion is i nice thing to have, but it hides the
> real types in the database.
> So how could i get this information?

If you use InterBase only, you can get that information from the
metadatabase.
Try this:

RDB$RELATIONS - this stores table information
RDB$FIELDS - this is for the fields (here you have the RDB$FIELD_TYPE field)
RDB$RELATION_FIELDS - connects relations to fields

you can figure out the others. (Oh, it is for InterBase 6.0 but the
others are similar or the same)

Cheers,

L 1.0


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Uwe Grauer  
View profile  
 More options Nov 26 2003, 11:15 am
Newsgroups: comp.lang.python
From: Uwe Grauer <n...@grauer-online.de>
Date: Wed, 26 Nov 2003 17:15:44 +0100
Local: Wed, Nov 26 2003 11:15 am
Subject: Re: kinterbas db column type

Does this mean, that the kinterbasdb isn't DB-API 2.0 compliant?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gandalf  
View profile  
 More options Nov 26 2003, 12:01 pm
Newsgroups: comp.lang.python
From: Gandalf <gand...@geochemsource.com>
Date: Wed, 26 Nov 2003 17:47:04 +0100
Local: Wed, Nov 26 2003 11:47 am
Subject: Re: kinterbas db column type

>>> i need to know the database column types returned by kinterbasdb.
>>> Implicit type conversion is i nice thing to have, but it hides the
>>> real types in the database.
>>> So how could i get this information?

>> RDB$RELATIONS - this stores table information
>> RDB$FIELDS - this is for the fields (here you have the RDB$FIELD_TYPE
>> field)
>> RDB$RELATION_FIELDS - connects relations to fields

> Does this mean, that the kinterbasdb isn't DB-API 2.0 compliant?

It is DB-API 2.0 compilant. I'm sorry, maybe I misunderstood you. This
is a way
to get the column types in InterBase inside. Do you want to know the
Python types
in the row returned by .fetch()?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Uwe Grauer  
View profile  
 More options Nov 26 2003, 1:50 pm
Newsgroups: comp.lang.python
From: Uwe Grauer <n...@grauer-online.de>
Date: Wed, 26 Nov 2003 19:50:40 +0100
Local: Wed, Nov 26 2003 1:50 pm
Subject: Re: kinterbas db column type

Sorry Gandalf,

more explanation:

It's different from other modules cause it does a implicit type
conversion to the Python-types.
So for a DATETIME-column in mysql you get a type_code 12 (which is
indeed DATETIME in MySQLdb) but in kinterbasdb you get  t_tuple. This
does not help me very much since the information i need is different
from what i get.

Uwe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gandalf  
View profile  
 More options Nov 26 2003, 3:01 pm
Newsgroups: comp.lang.python
From: Gandalf <gand...@geochemsource.com>
Date: Wed, 26 Nov 2003 20:22:16 +0100
Local: Wed, Nov 26 2003 2:22 pm
Subject: Re: kinterbas db column type

Okay, I created this table (InterBase 6.01):

create table PV_TEST
(
ID integer not null,
PT_TEST_ID integer not null,
INTVALUE integer,
BOOLVALUE integer,
FLOATVALUE double precision,
DATETIMEVALUE timestamp,
DATEVALUE timestamp,
TIMEVALUE timestamp,
TEXTVALUE blob sub_type text segment size 80,
PERSISTENTVALUE blob segment size 80
)

This is what I got from a cursor's description:

(('ID', <type 'int'>, 12, 4, 0, 0, False), ('PT_TEST_ID', <type 'int'>,
12, 4, 0, 0, False), ('INTVALUE', <type 'int'>, 12, 4, 0, 0, True),
('BOOLVALUE', <type 'int'>, 12, 4, 0, 0, True), ('FLOATVALUE', <type
'float'>, 17, 8, 0, 0, True), ('DATETIMEVALUE', <type 'tuple'>, 22, 8,
0, 0, True), ('DATEVALUE', <type 'tuple'>, 22, 8, 0, 0, True),
('TIMEVALUE', <type 'tuple'>, 22, 8, 0, 0, True), ('TEXTVALUE', <type
'str'>, 0, 8, 0, 1, True), ('PERSISTENTVALUE', <type 'str'>, 0, 8, 0, 0,
True))

The tuple type is really a tuple. Try this:

import time
time.gmtime()

This will give you a tuple. Well, you can ask for a separate DATE and
TIME type.
Well, in dialect 1, only TIMESTAMP supported.

Cheers,

L


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Uwe Grauer  
View profile  
 More options Nov 26 2003, 8:57 pm
Newsgroups: comp.lang.python
From: Uwe Grauer <n...@grauer-online.de>
Date: Thu, 27 Nov 2003 02:57:33 +0100
Local: Wed, Nov 26 2003 8:57 pm
Subject: Re: kinterbas db column type

Uwe Grauer wrote:

> more explanation:

> It's different from other modules cause it does a implicit type
> conversion to the Python-types.
> So for a DATETIME-column in mysql you get a type_code 12 (which is
> indeed DATETIME in MySQLdb) but in kinterbasdb you get  t_tuple. This
> does not help me very much since the information i need is different
> from what i get.

> Uwe

Got the answer in db-sig, thought i should share it:

David Rushby wrote:

This is a known problem in 3.1_pre6 and earlier.  It's fixed in the CVS
version, which I plan to release soon as 3.1_pre7.  Here's the relevant
SF bug report:
http://sourceforge.net/tracker/index.php?func=detail&aid=814276&group...

If you're not compiler- or CVS- constrained, use the CVS version right
now; it's quite stable.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »