Version 1 Calling convention

From: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Version 1 Calling convention
Date: 2006-08-30 04:25:28
Message-ID: a47902760608292125n2fef80b5n73c01f9314a8b629@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

I have a .pgc file and i have the following code snippet in it:

PG_FUNCTION_INFO_V1 (test);

Datum
test (PG_FUNCTION_ARGS)
{
EXEC SQL BEGIN DECLARE SECTION;
int id = PG_GETARG_INT(0);
char *raw_rawemail1 = PG_GETARG_CHAR_P(1);
char *rawemail1 = (char *) palloc (VARSIZE(rawemail1));
VARATT_SIZEP ( rawemail1 ) = VARSIZE (raw_rawemail1); //LINE 140
(thats where i get syntax error)
memcpy( (void *) (VARDATA) (rawemail1), (void *) (VARDATA)
(raw_rawemail1) , (VARSIZE) (raw_rawemail1) - VARHDRSZ );
EXEC SQL END DECLARE SECTION;

EXEC SQL CONNECT TO dbxyz;
}

When I compile this using
ECPG parser.pgc

I get the follwing error

Syntax error at or near 'rawemail1' (LINE 140 marked above)

Don't know what this error is all about.
Don't know if my declaration in BEGIN END block is correct in the pgc file
for version 1 calling convention

Thanks
~Jas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-30 04:28:15 Re: Version 1 Calling convention
Previous Message Aleksander Kmetec 2006-08-30 02:43:54 reindexdb and "could not open relation" error message

Browse pgsql-novice by date

  From Date Subject
Next Message Alvaro Herrera 2006-08-30 04:28:15 Re: Version 1 Calling convention
Previous Message Michael Fuhr 2006-08-30 01:02:20 Re: (FOR EACH STATEMENT AFTER UPDATE) Triggers & Transactions