Code Snippets PLSQL

Short texts PLSQL 🧑‍💻 Code snippets PLSQL ✍️ Reading lists PLSQL 👀

XML Type directive

/* xml variable, no TYPE directive */ DECLARE @xmlNoType xml SET @xmlNoType = ( SELECT * FROM sys.all_objects FOR XML PATH(”), ROOT (‘Document’) ) SELECT (DATALENGTH(@xmlNoType) / 1024.0) / 1024. AS SizeMB GO /* xml variable, TYPE directive */ DECLARE @xmlType xml SET @xmlType = ( SELECT * FROM sys.all_objects FOR XML PATH(”), ROOT (‘Document’), […]

PLSQL

PL/SQL # Programando en PL/SQL PL/SQL (Procedural Language/Structured Query Language) es un lenguaje de programación incrustado en Oracle. Links: * [https://livesql.oracle.com](https://livesql.oracle.com) –Curso PL/SQL — –1. SET SERVEROUTPUT ON; SET VERIFY OFF; DECLARE TOTAL NUMBER; BEGIN SELECT COUNT(*) INTO TOTAL FROM OLYM.OLYM_EVENTS WHERE id = 1000; dbms_output.put_line(‘Total: ‘||TO_CHAR(TOTAL)); EXCEPTION WHEN NO_DATA_FOUND THEN dbms_output.put_line(‘No hay registros en […]

secureliterals and refcursor

SQL> show secureliterals secureliterals DEFAULT SQL> set secureliterals off SQL> show secureliterals secureliterals OFF SQL> set echo on SQL> @test_5 SQL> set secureliterals off SQL> alter session set events ‘sql_trace level 12’; Session altered. SQL> var c refcursor; SQL> var n number; SQL> set arraysize 2; SQL> alter session set container=pdb1; Session altered. SQL> alter […]