开发者

how to use these sql scripts in oracle?

I have a sql-script like:

@tables\run.sql;

@sequences\run.sql;

@views\run.sql;

@functions\run.sql;

@procedures\run.sql;

And I have two questions:

  1. Do I need to开发者_如何学JAVA imply all the related script-files into the db?
  2. I execute the SQL script above in the PL/SQL developer but unfortunately it prompts ORA-00900 problem. Why so?


The sql script you indicate is trying to run several other sql scripts it expects to find in a directory structure like this

run.sql (your script above)
/tables
   run.sql
/sequences
   run.sql 
/views
   run.sql
/functions
   run.sql
/procedures
   run.sql

You dont mention if you are on a windows machine or unix/linux. If you are on unix/linux, normally you would use the sqlplus command line to run this script from the directory containing the top level run.sql (the one containing the commands you listed above).

PLSQL developer will run on windows so I assume it will use whichever directory is set as the "location" on the windows properties that you use to start plsql developer (probably something like c:\Program Files\plsqldev as a default so to find the scripts, it would expect the subdirectories (procedures/tables/view/sequences etc..) to be under that directory.

You will need all the scripts and to keep the subdirectory structure on either your windows client machine where plsql developer is running or on the database server where the Oracle database resides in order to run the script you have indicated above.


"I execute the SQL script above in the PL/SQL developer but unfortunately it prompts ORA-00900 problem. Why so?"

One of the, er, charms of PLSQL Developer is that it has many different types of windows which can do different things. It sounds like you are trying to run this script in a SQL window. Run it in a Command window instead, which is basically a SQL*Plus emulator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜