pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedECPG and FETCH
6+ messages / 4 participants
[nested] [flat]
* ECPG and FETCH
@ 2000-01-05 07:04 Tim Kane <timk@hotgames.com>
0 siblings, 0 replies; 6+ messages in thread
From: Tim Kane @ 2000-01-05 07:04 UTC (permalink / raw)
To: pgsql-interfaces
First of all, ECPG doesn't seem to recognise the FETCH command at all,
returning with Syntax Error (see below).
Secondly, are there any postgres specific Embedded SQL docs around
'anywhere'?
I've already have a few difficulties with subtle differences between
different precompiler syntax, and it's becoming frustrating.
eg:
EXEC SQL DECLARE rowcur CURSOR FOR
SELECT prod_id, name, format
FROM products
WHERE name like '%ABC%';
EXEC SQL OPEN rowcur;
for (i=0; i<5; i++)
{
EXEC SQL FETCH rowcur INTO :prod_id, :title, :format;
// Do something.
}
^ permalink raw reply [nested|flat] 6+ messages in thread
* ECPG and FETCH
@ 2000-01-05 07:12 Tim Kane <timk@hotgames.com>
0 siblings, 0 replies; 6+ messages in thread
From: Tim Kane @ 2000-01-05 07:12 UTC (permalink / raw)
To: pgsql-interfaces
First of all, ECPG doesn't seem to recognise the FETCH command at all,
returning with Syntax Error (see below).
Secondly, are there any postgres specific Embedded SQL docs around
'anywhere'?
I've already have a few difficulties with subtle differences between
different precompiler syntax, and it's becoming frustrating.
eg:
EXEC SQL DECLARE rowcur CURSOR FOR
SELECT prod_id, name, format
FROM products
WHERE name like '%ABC%';
EXEC SQL OPEN rowcur;
for (i=0; i<5; i++)
{
EXEC SQL FETCH rowcur INTO :prod_id, :title, :format;
// Do something.
}
^ permalink raw reply [nested|flat] 6+ messages in thread
* ECPG and FETCH
@ 2000-01-05 07:24 Tim Kane <timk@hotgames.com>
0 siblings, 3 replies; 6+ messages in thread
From: Tim Kane @ 2000-01-05 07:24 UTC (permalink / raw)
To: pgsql-interfaces
First of all, ECPG doesn't seem to recognise the FETCH command at all,
returning with Syntax Error (see below).
Secondly, are there any postgres specific Embedded SQL docs around
'anywhere'?
I've already have a few difficulties with subtle differences between
different precompiler syntax, and it's becoming frustrating.
Thanks for any help!
Tim.
eg:
EXEC SQL DECLARE rowcur CURSOR FOR
SELECT prod_id, name, format
FROM products
WHERE name like '%ABC%';
EXEC SQL OPEN rowcur;
for (i=0; i<5; i++)
{
EXEC SQL FETCH rowcur INTO :prod_id, :title, :format;
// Do something.
}
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [INTERFACES] ECPG and FETCH
@ 2000-01-05 15:04 Ivo Simicevic <ivo@ultra.hr>
parent: Tim Kane <timk@hotgames.com>
2 siblings, 0 replies; 6+ messages in thread
From: Ivo Simicevic @ 2000-01-05 15:04 UTC (permalink / raw)
To: Tim Kane <timk@hotgames.com>; +Cc: pgsql-interfaces
On Wed, Jan 05, 2000 at 06:24:51PM +1100, Tim Kane wrote:
> EXEC SQL FETCH rowcur INTO :prod_id, :title, :format;
>
Try EXEC SQL FETCH IN rowcur ...
Ivo.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [INTERFACES] ECPG and FETCH
@ 2000-01-05 16:07 Thomas Lockhart <lockhart@alumni.caltech.edu>
parent: Tim Kane <timk@hotgames.com>
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Lockhart @ 2000-01-05 16:07 UTC (permalink / raw)
To: Tim Kane <timk@hotgames.com>; +Cc: pgsql-interfaces
> Secondly, are there any postgres specific Embedded SQL docs around
> 'anywhere'?
> I've already have a few difficulties with subtle differences between
> different precompiler syntax, and it's becoming frustrating.
That's one of the holes in our documentation. If you get inspired to
write, we would welcome a contribution of any sort (including just
your notes on syntax as you learn to use the preprocessor). Our doc
sources are in sgml, but if you want to just write flat files I'll
convert it for you...
- Thomas
--
Thomas Lockhart lockhart@alumni.caltech.edu
South Pasadena, California
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [INTERFACES] ECPG and FETCH
@ 2000-01-05 18:30 Michael Meskes <meskes@postgreSQL.org>
parent: Tim Kane <timk@hotgames.com>
2 siblings, 0 replies; 6+ messages in thread
From: Michael Meskes @ 2000-01-05 18:30 UTC (permalink / raw)
To: pgsql-interfaces
On Wed, Jan 05, 2000 at 06:24:51PM +1100, Tim Kane wrote:
> First of all, ECPG doesn't seem to recognise the FETCH command at all,
> returning with Syntax Error (see below).
FETCH IN should work as well as FETCH FROM. I think this is what standard
says. I once tried to add FETCH without IN but got some shift/reduce
conflicts. I haven't looked into it for quite some time, so maybe I can add
a compatibility rule. But don't bet on it.
> Secondly, are there any postgres specific Embedded SQL docs around
> 'anywhere'?
Unfortunately not much. But there are some (5 to be precise) demo files in
the source tree.
Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De | Use PostgreSQL!
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2000-01-05 18:30 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-01-05 07:04 ECPG and FETCH Tim Kane <timk@hotgames.com>
2000-01-05 07:12 ECPG and FETCH Tim Kane <timk@hotgames.com>
2000-01-05 07:24 ECPG and FETCH Tim Kane <timk@hotgames.com>
2000-01-05 15:04 ` Ivo Simicevic <ivo@ultra.hr>
2000-01-05 16:07 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-01-05 18:30 ` Michael Meskes <meskes@postgreSQL.org>
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