user3122285
user3122285

Reputation: 13

When executing query that is after Declare End part is giving me error

I am running a query, but before that, I am executing a procedure from the database that changes the session access for the user that executes the query.

The Begin End part and the execution of the procedure call is executed just fine but when it tries to execute the select query it gives me the error ORA-06550 PLS 00103: Encountered the symbol WITH.

Like i am not able to execute the procedure call and then execute the select statement for some reason.

Please advise.

The initial call of the code is

Begin
 util.change_institutions(a_instition => 900);
End;

With Balance as ( Select * from cbalances where method=100),
User as ( select * from users where user_id = 10132)

Select * from Balance b
Full Join User u  on u.Serno=b.Serno;

I need this to be execute in a single session. Any ideas that might help me execute this?

Upvotes: 1

Views: 127

Answers (1)

Maheswaran Ravisankar
Maheswaran Ravisankar

Reputation: 17920

Please provide a '/' after PL/SQL Block;

Every PL/SQL Statement, only when '/' is given is actually flushed to the database engine.

Begin
 util.change_institutions(a_instition => 900);
End;
/

With Balance as ( Select * from cbalances where method=100),
User as ( select * from users where user_id = 10132)
Select * from Balance b
Full Join User u  on u.Serno=b.Serno;

Upvotes: 3

Related Questions