p******a 发帖数: 4 | 1 数据库APPLICATION PROGRAMMING,比如C程序调用SQL,
只用STORED PROCEDURE,够不够?
我的意思是程序中不出现SELECT 。。。,一切数据库操作都是
对STORED PROCEDURE的调用,可不可以?会有什么问题?
请高手指教 | s*k 发帖数: 144 | 2
Of course you can. But that is not a good database programming
practice.You may need to create too many stored procedures on
server and some only too trivial to bother your DBA to
create and consume system resource of server.
【在 p******a 的大作中提到】 : 数据库APPLICATION PROGRAMMING,比如C程序调用SQL, : 只用STORED PROCEDURE,够不够? : 我的意思是程序中不出现SELECT 。。。,一切数据库操作都是 : 对STORED PROCEDURE的调用,可不可以?会有什么问题? : 请高手指教
| a*****i 发帖数: 4391 | 3
Depends on what you need them for.
1: If you need a lot of interactive actions between your database and the
server, it is better to write the application in C/Perl/Java/whatever
language you are familiar with.
2: Otherwise, stored procedure runs faster. I dont know about in other DBs,
but Oracle's store procedure has a pretty well defined control structure in
which you can pretty much do everything you need to do .
3: You can not have DDL in stored proecedure body. That is a drawback.
【在 p******a 的大作中提到】 : 数据库APPLICATION PROGRAMMING,比如C程序调用SQL, : 只用STORED PROCEDURE,够不够? : 我的意思是程序中不出现SELECT 。。。,一切数据库操作都是 : 对STORED PROCEDURE的调用,可不可以?会有什么问题? : 请高手指教
| p******a 发帖数: 4 | 4 Thanks. I will use Stored Procedure for SQL only.
As you said , DDL cannot be put in SP.
But I doubt if I can put dynamic SQL in it?
How about CLI? For example, a web search engine needs to
form queries on the fly, can I use SP in this case?
Thanks again!
【在 a*****i 的大作中提到】 : : Depends on what you need them for. : 1: If you need a lot of interactive actions between your database and the : server, it is better to write the application in C/Perl/Java/whatever : language you are familiar with. : 2: Otherwise, stored procedure runs faster. I dont know about in other DBs, : but Oracle's store procedure has a pretty well defined control structure in : which you can pretty much do everything you need to do . : 3: You can not have DDL in stored proecedure body. That is a drawback.
| a*****i 发帖数: 4391 | 5 Oracle supports Dynamic SQL. So, go ahead and stop worrying:)
I am not sure how good the performance is though. I had done
some scripting in dynamic SQL, but the table was relatively small,
so the performance was really not a big issue there.
Hmm In that case, the best choice is to use Oracle webserver.
(I dont work for Oracle, btw.)
【在 p******a 的大作中提到】 : Thanks. I will use Stored Procedure for SQL only. : As you said , DDL cannot be put in SP. : But I doubt if I can put dynamic SQL in it? : How about CLI? For example, a web search engine needs to : form queries on the fly, can I use SP in this case? : Thanks again!
|
|