Re: Calling stored proc from PRO*C

From: Michael Ryan <ryan_at_xsoft.xerox.com>
Date: 1995/09/06
Message-ID: <1995Sep6.215225.12071_at_xsoft.uucp>#1/1


In article <424nd5$r2_at_babbage.ece.uc.edu>, ghaij_at_ucunix.san.uc.edu (Jasvinder Ghai) writes:
>In article <421pcs$25f_at_hearye.mlb.semi.harris.com>,
>Tom Gillespie <tgillesp_at_ms13.mis.semi.harris.com> wrote:
>>But when I try to execute it from an embedded C program,
>>I get "PCC-S-02313, 'TRACE' not declared in this scope".
>>Here is how I'm calling it from the C program:
>> EXEC SQL EXECUTE
>> BEGIN
>> trace (:lot_nr, :fac_cd);
>> END;
>> END-EXEC;
>>Do I have to declare the procedure name in a EXEC SQL DECLARE ?

no.

>The simplest solution is to use the login/password of owner of
>package/procedure during compilation.
> ie. if XXX is the actual owner of the package use XXX/password during
>compilation.

perhaps even easier is to use the fully qualified name of the procedure.

	EXEC SQL EXECUTE
	BEGIN
		XXX.trace ( :lot_nr, :fac_cd);
	END;
	END-EXEC;
	

you will have to give EXECUTE privilege to this procedure to the users that login to the C program. in the process of defining this procedure you should GRANT access:

	CREATE PROCEDURE trace ... AS
	BEGIN
	...
	END trace;
	GRANT EXECUTE ON trace TO PUBLIC;

PUBLIC being the most general. personally, i always define and use ROLES.

good luck
//michael

-- 
:: michael ryan , ryan_at_xsoft.xerox.com
:: ob disclaimer: opinions expressed are not those of xerox, corp.
Received on Wed Sep 06 1995 - 00:00:00 CEST

Original text of this message