I have come across a function before that displayed the exact SQL code that was used in a loop for example, but can't remember.
Can anybody tell me that function?
Cheers
|
|
|
Hi @Keith Donegan: If I understand your question correctly I think this is what you are looking for?
|
|||
|
|
|
See this answer: Best Collection of Code for your functions.php file Then add ?debug=sql to any WP URL, and it'll output the full list of queries that were run. (And yes, it's scary...) |
|||
|
|
|
If you ran a query based on
|
|||
|
|
|
If you are only interested in Loops this is what I usually use:
|
|||
|
|
|
Put_Line Processing Queries with PL/SQL Processing a SQL query with PL/SQL is like processing files with other languages. For example, a Perl program opens a file, reads the file contents, processes each line, then closes the file. In the same way, a PL/SQL program issues a query and processes the rows from the result set as shown in Example 1-5. Example 1-5 Processing Query Results in a LOOP BEGIN FOR someone IN (SELECT * FROM employees WHERE employee_id < 120 ) LOOP DBMS_OUTPUT.PUT_LINE('First name = ' || someone.first_name || ', Last name = ' || someone.last_name); END LOOP; END; /
|
|||
|