Re: How to set Oracle-roles from VB

From: Jim Lane <j.lane_at_bom.gov.au>
Date: Mon, 11 Jul 1994 10:26:31
Message-ID: <j.lane.1.000A717C_at_bom.gov.au>


In article <2vo3a0$3nn_at_search01.news.aol.com> rscary_at_aol.com (RSCary) writes:
>From: rscary_at_aol.com (RSCary)
>Subject: Re: How to set Oracle-roles from VB
>Date: 10 Jul 1994 02:09:04 -0400
 

>In article <1994Jul8.135531.6248_at_roche.com>, joerg.schmiedle_at_roche.com
>(Joerg Schmiedle) writes:
 

>Hi everybody,
 

>I'm working on VB and ODBC to connect to a remote Oracle V7.0.15.4.1
>database. I'm using SQLnet V1.1.7.9.1 and the Oracle 7 ODBC driver
>V1.10.0000.
 

>After a sucessful connect to the remote database, I try to set a role
>from my VB-application. The SQL-syntax (which works fine with SQLplus)
>is
>"SET ROLE ROLE_NAME;"
 
>The question is: How can I execute this SQL-statement from Visual
>Basic.
>I tried to use the ExecuteSQL-method, but doesn't work.
 

>Any comments?
>==========================================================
>Your problem is you are trying to execute a SQL*Plus command as SQL. It
>will only work in SQL*Plus.
 

>Scott Cary

SET ROLE is in fact a genuine SQL command. To execute from VB/ODBC try encapsulating in an PL/SQL block, eg.

a = dbname.ExecuteSQL("begin SET ROLE ROLE_NAME; end;")

You need PL/SQL option on your RDBMS to do this.

Jim Lane Received on Mon Jul 11 1994 - 10:26:31 CEST

Original text of this message