pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedWhen length of text data is 1.
2+ messages / 2 participants
[nested] [flat]
* When length of text data is 1.
@ 2006-10-30 18:19 НФСР <nfsr@hitv.ru>
0 siblings, 1 reply; 2+ messages in thread
From: НФСР @ 2006-10-30 18:19 UTC (permalink / raw)
To: pgsql-odbc
Hello,
I tried to search in Internet, but didn't find answer...
I'm using PostgreSQL 8.1.5-1, ODBC, MS Visual C++ with MFC, I'm using
Unicode (database has UTF8 encoding and I'm using "PostgreSQL Unicode" odbc
driver).
I create, for example, such table:
***code***
CREATE TABLE section (
idsection INT PRIMARY KEY,")
idparent INT NULL REFERENCES section ON DELETE CASCADE,")
name TEXT NOT NULL")
);
**********
Retrieve data thereby:
***code***
CRecordset rcrd(&db);
CString nm;
....
rcrd.GetFieldValue(_T("name"),nm);
**********
It works without any problem except when length of 'name' is 1.
For example, It works fine when name is 'John' but when name is 'J' line
rcrd.GetFieldValue(_T("name"),nm);
throws exception with empty exception message and AFAIK with return code
SQL_NO_DATA.
If I catch exception, nm equals 'J', but when application exits, Memory
Leaks is detected.
And I think, catching exception and then checking emptyness of exception
message is not good solution...
So, question...
Is this bug in my code or in MFC code or in ODBC driver's code?
What I should do to support strings with length == 1?
Thank you if you can help me..
Best regards,
Nail Samatov
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: When length of text data is 1.
@ 2006-11-07 03:34 Hiroshi Inoue <inoue@tpf.co.jp>
parent: НФСР <nfsr@hitv.ru>
0 siblings, 0 replies; 2+ messages in thread
From: Hiroshi Inoue @ 2006-11-07 03:34 UTC (permalink / raw)
To: НФСР <nfsr@hitv.ru>; +Cc: pgsql-odbc
НФСР wrote:
> Hello,
>
> I tried to search in Internet, but didn't find answer...
> I'm using PostgreSQL 8.1.5-1, ODBC, MS Visual C++ with MFC, I'm using
> Unicode (database has UTF8 encoding and I'm using "PostgreSQL Unicode" odbc
> driver).
> I create, for example, such table:
>
> ***code***
> CREATE TABLE section (
> idsection INT PRIMARY KEY,")
> idparent INT NULL REFERENCES section ON DELETE CASCADE,")
> name TEXT NOT NULL")
> );
> **********
>
> Retrieve data thereby:
>
> ***code***
> CRecordset rcrd(&db);
> CString nm;
> ....
> rcrd.GetFieldValue(_T("name"),nm);
> **********
>
> It works without any problem except when length of 'name' is 1.
> For example, It works fine when name is 'John' but when name is 'J' line
> rcrd.GetFieldValue(_T("name"),nm);
> throws exception with empty exception message and AFAIK with return code
> SQL_NO_DATA.
Which version of ODBC driver are you using ?
Could you send me the Mylog output ?
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-11-07 03:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-30 18:19 When length of text data is 1. НФСР <nfsr@hitv.ru>
2006-11-07 03:34 ` Hiroshi Inoue <inoue@tpf.co.jp>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox