Two simple troubles for PG newbee

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Post Reply
remnew
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 11.04.2008, 20:17

Two simple troubles for PG newbee

Post by remnew »

Good day for all!

I'm using Delphi 7 + ZEOS DBO ( :!: ) + PG database. Has anybody "live" simple source for next two questions.

1. How to send parameters to query on PG? On MySQL I've used ZQuery1.ParamByName property and in SQL text I've wrote such as

Code: Select all

select * from my_tyny_table where user=:username
How make analogue on PG? :oops:

2. How to get a cursor value in PG? So, i've wrote

Code: Select all

begin;
select f_modules_get_user_id_by_login('petrov','sdgfsdf');
This is ok, ZQuery1.RecordCount returns "1", but I don't need record count, but cursor value, for example user ID. How I can do this? :shock:
trupka
Expert Boarder
Expert Boarder
Posts: 140
Joined: 26.08.2007, 22:10

Post by trupka »

1.) paramByName works fine for me (pg8.2, Zeos 6.6.3-rc, Delphi7). Can say same for Interbase / Firebird.
2.) Maybe Zquery1.fields[1].value is what you seeking for ?
remnew
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 11.04.2008, 20:17

Post by remnew »

Thanks!. But I just solved it myself
Post Reply