emedded SQL in C to get the record type from plpgsql

Поиск
Список
Период
Сортировка
От Sun Duozhong(孙多忠)
Тема emedded SQL in C to get the record type from plpgsql
Дата
Msg-id 000001ca9fd6$fc3b4180$f4b1c480$@com
обсуждение исходный текст
Ответы Re: emedded SQL in C to get the record type from plpgsql
Список pgsql-bugs

So how can emedded SQL in C to get the record type which returning from plpgsql function?

I have tested as following code:

 

CREATE OR REPLACE FUNCTION test4(IN a integer, OUT b int,OUT c int) AS $BODY$ declare begin b:=100; c:=200; return; END $BODY$

  LANGUAGE 'plpgsql' VOLATILE

  COST 100;

 

 

// imbedded SQL in C

int test(int a)

{

 

EXEC SQL TYPE my_type IS STRUCT

{

int b[1];

int c[1];

};

 

EXEC SQL BEGIN DECLARE SECTION;

my_type ppp;

EXEC SQL END DECLARE SECTION;

 

EXEC SQL WHENEVER sqlerror SQLPRINT;

 

EXEC SQL select  test4(1) into :ppp;

EXEC SQL COMMIT;

return 0;

 

}

 

Running binary cause error:

SQL error: invalid input syntax for type int: "(100,200)",

 

My project is migrating from Oracle to postgresql,can you help me ?

 

 

Regards,

George

------------------------------------------------------------

Duozhong Sun

Guangdong Revenco Enterprise Co. Ltd. AMRI Department

Tel+86 20 8713 5305,+86 15800005957

Fax+86 20 87135388

Address368 Guangzhou Avenue South,Guangzhou 510300,P.R.C.

------------------------------------------------------------

 

В списке pgsql-bugs по дате отправления: