Unix Technical Forum

SQLColAttributes and SQL_DESC_NULLABLE

This is a discussion on SQLColAttributes and SQL_DESC_NULLABLE within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> Hello, I'm using .Net Odbc Data Provider, ODBC driver 8.1.x and PostgreSQL 8.1.0. To find out whether column can ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 02:36 AM
=?ISO-8859-2?Q?Robert_Jire=B9?=
 
Posts: n/a
Default SQLColAttributes and SQL_DESC_NULLABLE

Hello,
I'm using .Net Odbc Data Provider, ODBC driver 8.1.x and PostgreSQL 8.1.0.
To find out whether column can be null, the .NET calls ODBC function
SQLColAttributes. Problem is, that this function allways returns
SQL_NULLABLE, even for columns declared as NOT NULL. I tried to enable
"Parse Statements" option of the driver, but it didn't help.
I downloaded the latest sources, compiled them to see what's going on
inside and found this:
It seems that for SQLColAttributes to return something else than
SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
For some reason stmt->manual_result is true, which causes that the
statement is not parsed. What does this stmt->manual_result mean?

Thanks in advance.

Robert Jires


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 02:36 AM
Ludek Finstrle
 
Posts: n/a
Default Re: SQLColAttributes and SQL_DESC_NULLABLE

> SQLColAttributes. Problem is, that this function allways returns
> SQL_NULLABLE, even for columns declared as NOT NULL. I tried to enable
> "Parse Statements" option of the driver, but it didn't help.


Please, could you add this bug report to pgfoundry?
Feel free to try patch it.

> I downloaded the latest sources, compiled them to see what's going on
> inside and found this:
> It seems that for SQLColAttributes to return something else than
> SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
> For some reason stmt->manual_result is true, which causes that the
> statement is not parsed. What does this stmt->manual_result mean?


We think manual_result is only way to get result now. This problem
was create during convert to using libpq.

The driver isn't fully cleaned after rewrite to libpq support.
You can contact me directly in czech ;-) as my english is poor.

Luf

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 02:37 AM
Ludek Finstrle
 
Posts: n/a
Default Re: SQLColAttributes and SQL_DESC_NULLABLE

> It seems that for SQLColAttributes to return something else than
> SQL_NULLABLE, "Parse Statements" option MUST be turned on. Am i right?
> For some reason stmt->manual_result is true, which causes that the
> statement is not parsed. What does this stmt->manual_result mean?


I attach patch which solve this problem. Thanks to Robert to point
it and find the solution.

I don't know if it works with declare/fetch or server side prepare
(maybe other options could break it too). Please is there someone
who can test it? I can upload Windows DLL to test it if you want.

Thanks

Luf


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:54 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com