emedded SQL in C to get the record type from plpgsql

Started by Sun Duozhong(孙多忠)over 16 years ago2 messagesbugs
Jump to latest
#1Sun Duozhong(孙多忠)
sunduozhong@revenco.com

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

Address:368 Guangzhou Avenue South,Guangzhou 510300,P.R.C.

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

#2Craig Ringer
craig@2ndquadrant.com
In reply to: Sun Duozhong(孙多忠) (#1)
Re: emedded SQL in C to get the record type from plpgsql

Sun Duozhong(锟斤拷锟斤拷锟�) wrote:

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

You seem to have missed the fact that this isn't a web forum for help
questions. It's a bug report form. You are not reporting a bug. You are
not likely to get help by repeatedly posting via the bug report form.

Please ask for help on the pgsql-general mailing list or the
pgsql-newbies mailing list. I sent you the details for those in my last
email to you.

Failing that, you can get paid commercial support that will help you in
great detail from any one of a great many providers listed here:

http://www.postgresql.org/support/professional_support_asia

--
Craig Ringer