dbTalk Databases Forums  

[BUGS] BUG #2818: ADO Field.Attributes reports NULL on NOT NULL fields

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2818: ADO Field.Attributes reports NULL on NOT NULL fields in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brien R. Givens
 
Posts: n/a

Default [BUGS] BUG #2818: ADO Field.Attributes reports NULL on NOT NULL fields - 12-08-2006 , 07:45 PM







The following bug has been logged online:

Bug reference: 2818
Logged by: Brien R. Givens
Email address: ic3b3rg (AT) gmail (DOT) com
PostgreSQL version: 8.2
Operating system: Win XP
Description: ADO Field.Attributes reports NULL on NOT NULL fields
Details:

In ADO, the nullability of a field can be tested against its Attributes
property. Another option is to examine the Schema. As shown below, the
Attributes property of a NOT NULL field indicates it is nullable while the
Schema reports that it is not.

ADO Code:

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={PostgreSQL
ANSI};Server=localhost;Database=clinic;UID=clinic; PWD=c0nner99"

conn.Execute "DROP TABLE test"
conn.Execute "CREATE TABLE test (f1 INT NOT NULL)"

Set rs = Server.CreateObject("ADODB.recordset")
rs.Open "test", conn, adOpenStatic, adLockReadOnly, adCmdTableDirect

Response.Write ((rs(0).Attributes And adFldIsNullable) = adFldIsNullable) &
"<br>"
rs.Close

Set rs = conn.OpenSchema(adSchemaColumns,Array(Empty,Empty, "test","f1"))
Response.Write rs("IS_NULLABLE")

rs.Close
conn.Close


-- OUTPUT --

True
False

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.