pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedodbc 9.0.200 on delphi
2+ messages / 1 participants
[nested] [flat]
* odbc 9.0.200 on delphi
@ 2011-03-17 22:13 Julius Tuskenis <julius@nsoft.lt>
0 siblings, 1 reply; 2+ messages in thread
From: Julius Tuskenis @ 2011-03-17 22:13 UTC (permalink / raw)
To: pgsql-odbc
Hello, postgresql ODBC community
This is my first post so firstly I'd like to thank you for the ODBC
driver. We have several products using it (programming with Delphi 2006
using ADO components (dbGo)).
We are now upgrading Postgresql server to v9, so we had to change odbc
driver from 8.03.04.00 to 9.00.02.00. We observed some interesting
behavior - sometimes the query is executed, but now rows are returned
although we have no such problems executing queries using pgAdmin.
The problem occurs when the string parameter size is left as is (-1 in
Delphi ) and value of 5 characters is passed. If I pass more or less
character string - everything works as expected. Is the number 5 somehow
"magical" in pqsql ODBC ?...
Steps to reproduce:
1. Create a function
CREATE OR REPLACE FUNCTION _test(prm_1 character varying)
RETURNS integer AS
'select 0'
LANGUAGE sql VOLATILE
COST 100;
2. Create a test Delphi program that would have a ADOConnection,
ADOQuery, DataSource and DBGrid. Set the connection parameters, link the
objects.
3. Add SQL to ADOQuery:
select _test(:prm_test ) as kuku;
4. Add button to the project with code in OnClick event
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOConnection1.Connected := false;
ADOQuery1.Parameters[0].Value := '12345';
ADOQuery1.Open;
Caption := IntToStr(ADOQuery1.RecordCount);
end;
5. Execute the program, hit the button, observe the query returning
empty field in DBGrid, Caption becomes '0';
System info:
Server Version string PostgreSQL 9.0.3 on i486-pc-linux-gnu, compiled
by GCC gcc-4.4.real (Debian 4.4.5-10) 4.4.5, 32-bit
Client WinXP SP3
ODBC version 9.00.02.00 (Using PostgreSQL Unicode driver)
I understand It's two systems (odbc and delphi) that are tested, but I
don't know how to test ODBC only... Please advice what should I do about
it. Odbc v8.03.04.00 does not act like this.
Some more notices:
1. If I change OnClict event to
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOConnection1.Connected := false;
ADOQuery1.Parameters[0].Value := '12345';
ADOQuery1.Open;
ADOQuery1.Close;
ADOQuery1.Open;
Caption := IntToStr(ADOQuery1.RecordCount);
end;
Everything works as expected.
2. If I use query without parameters ( select _test('12345' ) as kuku;)
- everything is OK.
3. If I set parameter size of at least 6 result is ok.
I don't know what else to check. If there is a person who is willing to
fix the problem I'd be more than pleased to help. Don't hesitate to ask
for some logs or what ever information you find useful. I can provide
Delphi source for the test application if needed.
--
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: odbc 9.0.200 on delphi
@ 2011-03-18 07:23 Julius Tuskenis <julius@nsoft.lt>
parent: Julius Tuskenis <julius@nsoft.lt>
0 siblings, 0 replies; 2+ messages in thread
From: Julius Tuskenis @ 2011-03-18 07:23 UTC (permalink / raw)
To: pgsql-odbc
2011.03.18 00:13, Julius Tuskenis rašė:
> We observed some interesting behavior - sometimes the query is
> executed, but now rows are returned although we have no such problems
> executing queries using pgAdmin.
Should be
"We observed some interesting behavior - sometimes the query is
executed, but *no* rows are returned although we have no such problems
executing queries using pgAdmin. "
Sorry for the typing mistake.
--
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-03-18 07:23 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-03-17 22:13 odbc 9.0.200 on delphi Julius Tuskenis <julius@nsoft.lt>
2011-03-18 07:23 ` Julius Tuskenis <julius@nsoft.lt>
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