| Start |
|---|
| Select value with dynamic SQL Let's say a user wants to select data from different tables. A table is specified by the user. Call this function as usual: Table to test: |
| Insert values in dynamic SQL Example below inserts value into the table from the previous example: |
| Update values in dynamic SQL Let's update table from the first example: |
| Execute DDL statement This code creates the table: |
| Execute anonymous block You can execute anonymous block. This example shows also how to return value from dynamic SQL: RemarksSome important remarks: And this is right: There are two reasons for this. The first is the security. String concatenation allows to make SQL injection. In the query below, if a variable will contain value The second reason is performance. Oracle will parse query without parameters every time when it executes, while query with parameter will be parsed only once in the session. |
Read Article
https://develop.horje.com/learn/1434/reference