From: | "Thalis A(dot) Kalfigopoulos" <thalis(at)cs(dot)pitt(dot)edu> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | embedded SQL cursos declare fails |
Date: | 2001-06-18 19:59:56 |
Message-ID: | Pine.LNX.4.21.0106181545180.24987-100000@aluminum.cs.pitt.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Taken almost literally from the tutorial example (http://www.postgresql.org/idocs/index.php?app-ecpg.html) the following code:
<connectino establishment succesfull up to here>
EXEC SQL DECLARE my_cursor CURSOR FOR SELECT a,b FROM lala WHERE a= :i;
EXEC SQL FETCH FORWARD NEXT FROM my_cursor INTO :tmpa,:tmpb;
throws the following error in the logs:
2001-06-18 15:41:02 DEBUG: query: begin transaction
2001-06-18 15:41:02 DEBUG: ProcessUtility: begin transaction
2001-06-18 15:41:02 DEBUG: query: fetch forward next from my_cursor
2001-06-18 15:41:02 DEBUG: ProcessUtility: fetch forward next from my_cursor
2001-06-18 15:41:02 NOTICE: PerformPortalFetch: portal "my_cursor" not found
I check the .c file generated by ecpg and the cursor declaration is commented out :-(
#line 10 "main.pgc"
/* declare my_cursor cursor for select a , b from lala where a = ? */
#line 11 "main.pgc"
what's missing?
thanks,
thalis
ps there is a spelling mistake in the tutorial:
EXEC SQL FETCH foo_bar INTO :FooBar,DooDad; should be
EXEC SQL FETCH foo_bar INTO :FooBar,:DooDad;
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-06-18 20:00:12 | Re: aggregate function for median calculation |
Previous Message | Ryan Mahoney | 2001-06-18 19:59:03 | Re: max_expr_depth |