Can an oracle SQL query execute a string query selected from a table?

前端 未结 3 1549
迷失自我
迷失自我 2021-01-23 10:34

When using oracle SQL is it possible to run a query based on a text_string from a subquery? An example might clarify what I\'m trying to do

    select count(sql_         


        
3条回答
  •  甜味超标
    2021-01-23 10:59

    Going through Basics..

    When the database executes an SQL
    1) It would first do SEMANTIC check by validating the syntax and the objects (tables and columns used) in SQL.
    2) Based on it, the optimizer draws a PLAN(calculating the indexes to be used, with the available table statistics and histograms)..
    3) And the SQL Engine executes the Query as per the PLAN.

    So, all these means, the SQL cannot do dynamic object referings.. Since it needs to study all the elements in SQL before execution itself.

    Hence, unfortunately, your requirement is NOT possible with a simple SQL solution.

    PL/SQL or some other Database specific special tools.. is what you have to opt for.

提交回复
热议问题