Page 1 of 1

select error in Zquery

Posted: 01.03.2008, 02:45
by rivercarlos
Hi,

I have a problem with zquery, I execute a select for some table system, for example pg_description an error

The code is:

ZQuery3.SQL.Text := 'SELECT * FROM pg_description WHERE objoid = '+
InttoStr(relid)+' AND objsubid = 0';

I extract a valid 'relid' of other tables, and the same sentence if it runs well on phppgadmin

use postgres 8.1.4, delphi 2006 and zeos 6.6.2 rc

Someone can help me?
thanks

sorry, because my english not very good.

Posted: 02.03.2008, 13:45
by mdaems
First question : did you try to add a ZSQLMonitor to your project to check what query is sent to the server? Just to make sure it's not a typographic error.

Second question: could you please tell us WHAT error you get? Usually that tells half of the solution...

Mark

Posted: 02.03.2008, 21:41
by rivercarlos
Hi,

In response to the first question, this is the consultation that is sent to the server:

2008-03-02 21:25:54 cat: Execute, proto: postgresql-8, msg: SELECT * FROM pg_description WHERE objoid = 32859 AND objsubid = 0

The same query:

SELECT * FROM pg_description WHERE objoid = 32859 AND objsubid = 0

runs either from the phpPgAdmin

In response to the second question, this is the error that occurs at run time to try running the query above:

"Access violation at address 00000000. Read of address 00000000"


Carlos

Posted: 03.03.2008, 01:24
by sandeep_c24
Hi rivercarlos

I just ran the query "SELECT * FROM pg_description WHERE objoid = 32859 AND objsubid = 0 " and it worked fine. I didn't get any exception.

Could you try a a new application with bare minimum stuff and try and run this query.

Regards

Sandeep

Posted: 03.03.2008, 23:33
by zippo
1. Check the DLLs
2. Is the query created at runtime? If yes, check the Connection property,.. etc.

if nothing works, post an example source + db.

Posted: 04.03.2008, 12:40
by rivercarlos
Hi sandeep_c24,

I have made a new application, very simple, just with a ZQuery and a ZConnection, but I have got the same exception again.

Could you post here your code to see if I am making any mistake? I would like you to post your code and the properties you have used in your ZQuery.

Thanks,
Carlos