Why SQLBindCol can not get back the c string length.

Why SQLBindCol can not get back the c string length.

am 22.07.2006 07:59:06 von huming

Hi,

I am not familiar with ODBC.

Why I can not get the actual length from StrLen_or_IndPtr,the last paramter
of SQLBindCol(). The value of it
always keep the input one.
Also, for varchar string, the return c string is with right length, while
for fixed chars in DB, the returned c string is
always with the fixed char length in DB, there are space appended in c
string.

Could anybody pls help me on it, thanks.

Best Regards
Ivan


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 11:06:41 von Ludek Finstrle

> Why I can not get the actual length from StrLen_or_IndPtr,the last paramter
> of SQLBindCol(). The value of it always keep the input one.

When you want to get the value? You can't get it after SQLBindCol() call.
Please read the specification at:
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/odbc/htm/odbcsqlbindcol.asp

If I misunderstand your notice please correct me.

> Also, for varchar string, the return c string is with right length, while
> for fixed chars in DB, the returned c string is
> always with the fixed char length in DB, there are space appended in c
> string.

I see you have no clue what's the difference betwwen char and varchar
type in PostgreSQL. Please read the PostgreSQL manual. It isn't ODBC
related (http://www.postgresql.org/docs).

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 12:48:49 von huming

Thanks for your response.

I mean after calling SQLFetch(), the value could not be gotten.

-----Original Message-----
From: Ludek Finstrle [mailto:luf@pzkagis.cz]
Sent: Monday, July 24, 2006 5:07 PM
To: Hu, Ming (Ivan)
Cc: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Why SQLBindCol can not get back the c string length.


> Why I can not get the actual length from StrLen_or_IndPtr,the last
paramter
> of SQLBindCol(). The value of it always keep the input one.

When you want to get the value? You can't get it after SQLBindCol() call.
Please read the specification at:
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/odbc/htm/od
bcsqlbindcol.asp

If I misunderstand your notice please correct me.

> Also, for varchar string, the return c string is with right length, while
> for fixed chars in DB, the returned c string is
> always with the fixed char length in DB, there are space appended in c
> string.

I see you have no clue what's the difference betwwen char and varchar
type in PostgreSQL. Please read the PostgreSQL manual. It isn't ODBC
related (http://www.postgresql.org/docs).

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 12:54:40 von Ludek Finstrle

> I mean after calling SQLFetch(), the value could not be gotten.

What psqlODBC version are you using? Does the psqlODBC DLL from
http://www.geocities.jp/inocchichichi/psqlodbc/index.html
solve your problem?

If the problem persist after using the newest DLL (from URL above)
please send us the mylog output.

Regards,

Luf

> > Why I can not get the actual length from StrLen_or_IndPtr,the last
> paramter
> > of SQLBindCol(). The value of it always keep the input one.
>
> When you want to get the value? You can't get it after SQLBindCol() call.
> Please read the specification at:
> http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/odbc/htm/od
> bcsqlbindcol.asp
>
> If I misunderstand your notice please correct me.

---------------------------(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

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 13:06:20 von huming

The application is working with unixODBC driver manager on solaris.
psqlODBC version is 07.03.0100, and unixODBC version is 2.2.11,
Do you think is that possible caused by unixODBC driver manager used?

Thanks&Regards,
Ivan

> I mean after calling SQLFetch(), the value could not be gotten.

What psqlODBC version are you using? Does the psqlODBC DLL from
http://www.geocities.jp/inocchichichi/psqlodbc/index.html
solve your problem?

If the problem persist after using the newest DLL (from URL above)
please send us the mylog output.

Regards,

Luf

> > Why I can not get the actual length from StrLen_or_IndPtr,the last
> paramter
> > of SQLBindCol(). The value of it always keep the input one.
>
> When you want to get the value? You can't get it after SQLBindCol() call.
> Please read the specification at:
>
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/odbc/htm/od
> bcsqlbindcol.asp
>
> If I misunderstand your notice please correct me.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 13:39:05 von Ludek Finstrle

> The application is working with unixODBC driver manager on solaris.
> psqlODBC version is 07.03.0100, and unixODBC version is 2.2.11,
> Do you think is that possible caused by unixODBC driver manager used?

I don't think so. But 07.03.0100 is old and I don't know if it was
release version. Could you try current CVS from
http://pgfoundry.org/scm/?group_id=1000125
?

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Re: Why SQLBindCol can not get back the c string length.

am 24.07.2006 14:21:31 von huming

Unfortunately, for now I can not update the psqlODBC version myself.
I will try it later.
Thanks.
Ivan

> The application is working with unixODBC driver manager on solaris.
> psqlODBC version is 07.03.0100, and unixODBC version is 2.2.11,
> Do you think is that possible caused by unixODBC driver manager used?

I don't think so. But 07.03.0100 is old and I don't know if it was
release version. Could you try current CVS from
http://pgfoundry.org/scm/?group_id=1000125
?

Regards,

Luf

---------------------------(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