pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedPorting embedded SQL from Oracle to Postgres
3+ messages / 3 participants
[nested] [flat]
* Porting embedded SQL from Oracle to Postgres
@ 2005-10-09 21:57 Daniel Clayton <dwbc@hotmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Clayton @ 2005-10-09 21:57 UTC (permalink / raw)
To: pgsql-interfaces
I am getting an error when attempting to compile using ecpg.
ERROR: syntax error at or near "TYPE"
This code was originally written for Oracle using Pro*/C
from header:
#define RAW_BUFFER_SIZE 524287
typedef struct {
long len;
char buffer[RAW_BUFFER_SIZE];
} internalCompiledData_t;
from .pgc :
EXEC SQL TYPE internalCompiledData_t is LONG VARRAW(RAW_BUFFER_SIZE);
static internalCompiledData_t compiledData;
It appears that the syntax EXEC SQL TYPE .. is ... ; is Oracle specific, is
there a matching syntax for ecpg?
Or possibly a different way to achieve this datatype equivalencing?
Thanks in advance.
Daniel.
_________________________________________________________________
Find the coolest online games @ http://xtramsn.co.nz/gaming
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Porting embedded SQL from Oracle to Postgres
@ 2005-10-10 00:54 Michael Fuhr <mike@fuhr.org>
parent: Daniel Clayton <dwbc@hotmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Fuhr @ 2005-10-10 00:54 UTC (permalink / raw)
To: Daniel Clayton <dwbc@hotmail.com>; +Cc: pgsql-interfaces
On Mon, Oct 10, 2005 at 10:57:37AM +1300, Daniel Clayton wrote:
> It appears that the syntax EXEC SQL TYPE .. is ... ; is Oracle specific, is
> there a matching syntax for ecpg?
ECPG appears to have at least some support for EXEC SQL TYPE: I see
code to handle it in preproc/preproc.y and some of the test programs
use it. I haven't used it myself; maybe the programs in the source
code under src/interfaces/ecpg/test will provide helpful examples.
--
Michael Fuhr
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Porting embedded SQL from Oracle to Postgres
@ 2005-10-10 10:27 Michael Meskes <meskes@postgresql.org>
parent: Daniel Clayton <dwbc@hotmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Meskes @ 2005-10-10 10:27 UTC (permalink / raw)
To: Daniel Clayton <dwbc@hotmail.com>; +Cc: pgsql-interfaces
On Mon, Oct 10, 2005 at 10:57:37AM +1300, Daniel Clayton wrote:
> I am getting an error when attempting to compile using ecpg.
>
> ERROR: syntax error at or near "TYPE"
> ...
> EXEC SQL TYPE internalCompiledData_t is LONG VARRAW(RAW_BUFFER_SIZE);
Just trying precompiling this statement gives:
t.pgc:1: ERROR: syntax error at or near "VARRAW"
And this is the expected result as ECPG does not know the VARRAW
datatype. I would be interested to implement this however if I find the
time.
> It appears that the syntax EXEC SQL TYPE .. is ... ; is Oracle specific, is
> there a matching syntax for ecpg?
> Or possibly a different way to achieve this datatype equivalencing?
Could you send me a file where ecpg does not accept the TYPE command? It
should be available as long as you use variable types ecpg recognizes.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
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] 3+ messages in thread
end of thread, other threads:[~2005-10-10 10:27 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-09 21:57 Porting embedded SQL from Oracle to Postgres Daniel Clayton <dwbc@hotmail.com>
2005-10-10 00:54 ` Michael Fuhr <mike@fuhr.org>
2005-10-10 10:27 ` 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