Re: Calling stored function that returns a cursor from a libpq program

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mazen Abdel-Rahman <saba(dot)mazen(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Calling stored function that returns a cursor from a libpq program
Date: 2009-08-13 16:43:49
Message-ID: 23969.1250181829@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Mazen Abdel-Rahman <saba(dot)mazen(at)gmail(dot)com> writes:
> //get the name of the returned cursor

> char * cursorReturned;

> cursorReturned = PQgetvalue(queryResult4, 0, 0);

> NSString * fetchNextQuery = [NSString stringWithFormat:@"FETCH ALL in %s",
> cursorReturned];

I'd try double quoting that, ie
stringWithFormat:@"FETCH ALL in \"%s\"",

As-is you're risking trouble with mixed-case names, which is what you
seem to be using.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Greg Stark 2009-08-13 19:11:12 Re: ERROR: Too many updates/deletes within transaction (cmin
Previous Message Mazen Abdel-Rahman 2009-08-13 16:04:37 Re: Calling stored function that returns a cursor from a libpq program