Posts

Showing posts from September, 2025
Image
  Scalar Data Types are the building blocks of PL/SQL. Check the images to understand numeric data types - NUMBER, BINARY_FLOAT, BINARY_DOUBLE, BINARY_INTEGER and PLS_INTEGER. https://www.linkedin.com/feed/update/urn:li:activity:7319220779810729984?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAHUA7sBrzo1SCAyjeql1qiSe9GQS2mmWX4
Image
  Supercharge Your PL/SQL Skills. Unlock the full power of Oracle PL/SQL by mastering datatypes and the %TYPE attribute. These concepts are key to writing dynamic, flexible, and error-free PL/SQL code. Explore Oracle PL/SQL Datatypes: Get familiar with the various scalar, composite, and reference datatypes. Understanding these will help you write more efficient, memory-optimized code that’s adaptable to changing table structures. Master the %TYPE Attribute: Use the %TYPE attribute to dynamically declare variables that match the exact datatype of your table columns. This ensures your code stays error-free, and you won’t have to worry about datatype mismatches in your variables. Keep your code smart, dynamic, and efficient. https://www.linkedin.com/feed/update/urn:li:activity:7319002486239883265?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAHUA7sBrzo1SCAyjeql1qiSe9GQS2mmWX4
Image
  Ever get confused about when to use a bind variable versus a substitution variable in Oracle PL/SQL? Attached images provides a clear overview of the different variable types and their use cases and Non-PL/SQL variables like Bind and Host Variables. Different kinds of variables in Oracle based on where they are used and how they are managed. 1. PL/SQL Variables DECLARE v_salary NUMBER := 50000; BEGIN DBMS_OUTPUT.PUT_LINE('Salary is ' || v_salary); END; / 2.Bind Variables VARIABLE g_salary NUMBER BEGIN :g_salary := 60000; END; / PRINT g_salary 3. Substitution Variables SELECT * FROM employees WHERE department_id = &dept_id; 4. System Variables BEGIN DBMS_OUTPUT.PUT_LINE('Current User: ' || USER); DBMS_OUTPUT.PUT_LINE('Today: ' || SYSDATE); END; / 5. Cursor Variables (REF CURSOR) DECLARE TYPE emp_cur IS REF CURSOR; v_emp_cursor emp_cur; BEGIN OPEN v_emp_cursor FOR SELECT * FROM employees; -- Process the cursor here END; / Short Memory Tip: Colon : → Bind Va...
Image
  Master the Basics of PL/SQL Variables. Understanding how to declare, initialize, and manage variables is the first real step toward becoming a strong Oracle PL/SQL Developer. Attached is a easy-to-follow visual guide covering: ✅ What are variables ✅ Naming conventions ✅ Guidelines for declaring ✅ Keywords used during initialization (:=, DEFAULT, NOT NULL) ✅ Valid combinations and common pitfalls (like PLS-00218 error) Keywords Used During Variable Initialization: 1. := Assign a value directly Example v_salary NUMBER := 50000; 2. DEFAULT Set a default value Example v_bonus NUMBER DEFAULT 1000; 3. NOT NULL Enforce non-nullability (must initialize) Example v_id NUMBER NOT NULL := 101; 4. CONSTANT Make the variable a constant (fixed value) — must initialize at declaration Example c_tax_rate CONSTANT NUMBER := 18; Save it, share it, or bookmark it for quick revision. https://www.linkedin.com/feed/update/urn:li:activity:7318897903215788033?utm_source=share&utm_medium=member_d...