pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
EXEC SQL INCLUDE syntax
5+ messages / 2 participants
[nested] [flat]

* EXEC SQL INCLUDE syntax
@ 2003-10-17 22:42  Andrew S Halper <ashalper@usgs.gov>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew S Halper @ 2003-10-17 22:42 UTC (permalink / raw)
  To: pgsql-interfaces

I'm trying to port some Ingres code to PostgreSQL.  For Ingres, I had this bit  
of ESQL:

EXEC SQL INCLUDE '../dcl/master_table.sc';

which ecpg (2.10.0) can't digest with single quotes, and Ingres (2.5) esqlc  
can't digest without single quotes.

Can anyone tell me what the ESQL standard says, and if there is an easy ecpg  
work-around?

Thanks,
Andy


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: EXEC SQL INCLUDE syntax
@ 2003-10-20 18:01  Michael Meskes <meskes@postgresql.org>
  parent: Andrew S Halper <ashalper@usgs.gov>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Meskes @ 2003-10-20 18:01 UTC (permalink / raw)
  To: Andrew S Halper <ashalper@usgs.gov>; +Cc: pgsql-interfaces

On Fri, Oct 17, 2003 at 03:42:20PM -0700, Andrew S Halper wrote:
> I'm trying to port some Ingres code to PostgreSQL.  For Ingres, I had this 
> bit  of ESQL:
> 
> EXEC SQL INCLUDE '../dcl/master_table.sc';
> 
> which ecpg (2.10.0) can't digest with single quotes, and Ingres (2.5) esqlc 
> can't digest without single quotes.

ecpg only accepts double quotes or no quote at all.

> Can anyone tell me what the ESQL standard says, and if there is an easy 

I thought that ecpg does implement the standard, but I haven't checked
it lately so I'm not sure.

> ecpg  work-around?

Other than changing the code, no. It seems we do need an Ingres
compatibility mode, too.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: EXEC SQL INCLUDE syntax
@ 2003-10-20 20:50  Andrew S Halper <ashalper@usgs.gov>
  parent: Michael Meskes <meskes@postgresql.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew S Halper @ 2003-10-20 20:50 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: Andrew S Halper <ashalper@usgs.gov>; pgsql-interfaces

On 2003.10.20 11:01, Michael Meskes wrote:
> On Fri, Oct 17, 2003 at 03:42:20PM -0700, Andrew S Halper wrote:
> > I'm trying to port some Ingres code to PostgreSQL.  For Ingres, I had this
> > bit  of ESQL:
> >
> > EXEC SQL INCLUDE '../dcl/master_table.sc';
> >
> > which ecpg (2.10.0) can't digest with single quotes, and Ingres (2.5)  
> esqlc
> 
> > can't digest without single quotes.
> 
> ecpg only accepts double quotes or no quote at all.

Changing the single quotes to double quotes worked with the Ingres  
preprocessor, but not with ecpg:

natasha:~/nwis-4.4/common/db/midas-tools> ls -l master_table.sc
-rw-r--r--    1 ashalper nwdba         158 Oct 20 13:46 master_table.sc
natasha:~/nwis-4.4/common/db/midas-tools> ecpg drop_table.sc
drop_table.sc:37: ERROR: Cannot open include file "master_table.sc" in line 37

Thanks,
Andy


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: EXEC SQL INCLUDE syntax
@ 2003-10-21 07:47  Michael Meskes <meskes@postgresql.org>
  parent: Andrew S Halper <ashalper@usgs.gov>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Meskes @ 2003-10-21 07:47 UTC (permalink / raw)
  To: Andrew S Halper <ashalper@usgs.gov>; +Cc: pgsql-interfaces

On Mon, Oct 20, 2003 at 01:50:08PM -0700, Andrew S Halper wrote:
> Changing the single quotes to double quotes worked with the Ingres  
> preprocessor, but not with ecpg:
> 
> natasha:~/nwis-4.4/common/db/midas-tools> ls -l master_table.sc
> -rw-r--r--    1 ashalper nwdba         158 Oct 20 13:46 master_table.sc
> natasha:~/nwis-4.4/common/db/midas-tools> ecpg drop_table.sc
> drop_table.sc:37: ERROR: Cannot open include file "master_table.sc" in line 
> 37

It seems ecpg parsed the statement correctly but could not find the
file. IIRC double quotes mean to not search all include paths but take
"." instead.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: EXEC SQL INCLUDE syntax
@ 2003-10-21 16:32  Andrew S Halper <ashalper@usgs.gov>
  parent: Michael Meskes <meskes@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew S Halper @ 2003-10-21 16:32 UTC (permalink / raw)
  To: Michael Meskes <meskes@postgresql.org>; +Cc: Andrew S Halper <ashalper@usgs.gov>; pgsql-interfaces

On 2003.10.21 00:47, Michael Meskes wrote:
> On Mon, Oct 20, 2003 at 01:50:08PM -0700, Andrew S Halper wrote:
> > Changing the single quotes to double quotes worked with the Ingres
> > preprocessor, but not with ecpg:
> >
> > natasha:~/nwis-4.4/common/db/midas-tools> ls -l master_table.sc
> > -rw-r--r--    1 ashalper nwdba         158 Oct 20 13:46 master_table.sc
> > natasha:~/nwis-4.4/common/db/midas-tools> ecpg drop_table.sc
> > drop_table.sc:37: ERROR: Cannot open include file "master_table.sc" in  
> line
> 
> > 37
> 
> It seems ecpg parsed the statement correctly but could not find the
> file. IIRC double quotes mean to not search all include paths but take
> "." instead.

I must be doing something wrong because I can't get ecpg to include anything  
with double quotes around it.  I guess I'll just put something in the Makefile  
to strip the single quotes out of the Ingres includes.

I'll send you the two files off-list and you can experiment with it if you  
like.

Andy


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-10-21 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-17 22:42 EXEC SQL INCLUDE syntax Andrew S Halper <ashalper@usgs.gov>
2003-10-20 18:01 ` Michael Meskes <meskes@postgresql.org>
2003-10-20 20:50   ` Andrew S Halper <ashalper@usgs.gov>
2003-10-21 07:47     ` Michael Meskes <meskes@postgresql.org>
2003-10-21 16:32       ` Andrew S Halper <ashalper@usgs.gov>

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