Re: Pro*C and Roles

From: Guy Lapierre <glapier_at_mediom.qc.ca>
Date: 1996/02/02
Message-ID: <4es6g1$92v_at_news.bellglobal.com>#1/1


peters_at_mitre.org (Peter Sylvester) wrote:

>In article <4e6m30$8ar_at_news1.radix.net>, jfw_at_radix.net (Jim Ward) wrote:
 

>> Does anyone know if it is possible to set a role using Pro*C?
>> The following code below fails...
>>
>> /*----------------------------------------------------*/
>> exec sql begin declare section;
>> VARCHAR myrole[20];
>> exec sql end declare section;
>>
>> .. some C code ...
>>
>> strcpy(myrole.arr, "adpi");
>> myrole.len = strlen(myrole.arr);
>>
>> exec sql set role :myrole;

>Just a WAG:
 

>exec sql begin declare section;
>varchar mysql[200];
>exec sql end declare section;
 

>sprintf(mysql.arr, "set role %s", "adpi");
>mysql.len = strlen(mysql.arr);
>exec sql execute immediate :mysql;
 

>--
>Peter Sylvester
>MITRE Corp.
>Bedford, MA
>(peters_at_mitre.org)

Or you can use the package DBMS_SESSION.SET_ROLE(...) that you can call from your PRO*C program. I'm not sure of the name of the package but it's something like that. You can look in the Oracle book, there's a table with all the package that come with Oracle and that you can install.

Guy Lapierre
DMR
Quebec, CAN
(glapier_at_mediom.qc.ca) Received on Fri Feb 02 1996 - 00:00:00 CET

Original text of this message