select error in Zquery

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
rivercarlos
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 01.03.2008, 02:23

select error in Zquery

Post 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.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
rivercarlos
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 01.03.2008, 02:23

Post 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
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

Post 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
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post 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.
rivercarlos
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 01.03.2008, 02:23

Post 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
Post Reply