0

I created a procedure that into it, the procedure, connect to a database. but when I run it, I gave an error:

ora-00900: invalid SQL statement

my procedure is below:

create or replace procedure check_p
as
st:='connect xx/xxx@databasename';
execute immediate st;

end;
/

please help me

jarlh
  • 42,561
  • 8
  • 45
  • 63
roya jafari
  • 3
  • 1
  • 4
  • 1
    Possible duplicate of [ORA-00900: invalid SQL statement- when run a procedure in oracle 10g](https://stackoverflow.com/questions/13722307/ora-00900-invalid-sql-statement-when-run-a-procedure-in-oracle-10g) – demo Feb 26 '19 at 08:59
  • 3
    What is it that you actually want to do? Stored procedures exist on the database server so they are already connected to a database. If you want to access a different database the canonical thing to do would be to use a database link. https://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_concepts002.htm#ADMIN12083 – Jens Schauder Feb 26 '19 at 09:01

0 Answers0