Re: Use of C function parameters from embedded SQL
От | Michael Meskes |
---|---|
Тема | Re: Use of C function parameters from embedded SQL |
Дата | |
Msg-id | 20010621091104.A4208@feivel.credativ.de обсуждение исходный текст |
Ответ на | Use of C function parameters from embedded SQL ("Dick Brooks" <dick@8760.com>) |
Ответы |
Authentification
|
Список | pgsql-general |
On Thu, Jun 14, 2001 at 02:16:29PM -0500, Dick Brooks wrote: > Here is a section of embedded SQL code that works fine in Oracle (some code > removed for brevity): > > void open_database(char *user_name, char*pass_word) > { > EXEC SQL CONNECT :user_name IDENTIFIED BY :pass_word; > } This only work with Pro*C if you run it in full parse mode. That means Pro*C will parse your complete C file an not just the EXEC SQL parts. I would not recommend doing this. At first glance it looks like a nice feature but you can run into numerous sorts of trouble. > The only way I could get ecpg to process this code was to include a DECLARE > section, for example: Yes, that's the standard way of doing this. > Does anyone know of a workaround to allow use of the function parameters > with having to declare them first? No, there is none. The full parse mode has been on my todo list for a long time but with very low priority. Sorry. Michael -- Michael Meskes Michael@Fam-Meskes.De Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
В списке pgsql-general по дате отправления: