Should I use a stored procedure to execute a complex SELECT query?

I am working on what is a rather complicated SELECT query. I have several hierarchical queries nested in a single SELECT, and it is difficult to handle.

I come across several places where my built-in views should be executed in several places, so it seems reasonable to execute them once at the beginning of the stored procedure, and then do some iteration if necessary.

I am wondering if there are any reasons why I should not or could not perform the Oracle Stored Procedure called through my PHP code and return a result set as an OUT parameter. I usually used SP only to do updates / deletes / inserts, but the explicit size and complexity of this request seems to need to be broken.

If there is no technical problem with this, any comments regarding good or bad practice?

+3
source share
4 answers

Im working on what is a rather complicated SELECT query. I have several hierarchical queries nested in a single SELECT, and it is difficult to handle.

, ? ?

, , , .

- .

, - , Oracle Stored Procedure, PHP-, OUT . - , ?

, , . :

  • , , - . , , dbs, , Oracle, .
  • . : db - , harware , - , webserver/php, .

, :

  • . , , , .
  • . , . , , .
  • rountrips: , rountrips db, rountrip. .

, - . , , php/java/perl/pick your poison, .

+4

,

+2

PHP , , Ref Cusrors. Oracle + PHP Cookbook .

, , , , . , , SQL- , , , "//", .

" ?" , :

, .

, PL/SQL , . , PL/SQL , SQL. : , .

, , , SQL .

, , .

+2

, . SQL- - . , , -, , . . , , , , , .

, SQL , , , , .

, , , , , , "", . .. [Edit: , , , ..]

, . , Oracle.

+1

Source: https://habr.com/ru/post/1732929/


All Articles