Showing posts with the label plsql

[FIXED] %TYPE for collection's element type

Issue We can use record_name.field% type to reference a field's type... But if field is a col…

[FIXED] Freezing/hanging when executing Oracle DB PL/SQL procedure in Python

Issue Hello I created a PLSQL procedure to update or insert quantity in inventory table based on pr…

[FIXED] Generate a random date in Oracle with DBMS_RANDOM

Issue I have this anonymous block: DECLARE V_DATA DATE; BEGIN V_DATA := '01-GEN-2000&…

[FIXED] Oracle chr() diferent returns from SQL engine versus PL/SQL engine, why?

Issue Same function, same argument, different outputs: set serveroutput on; declare n number :…

[FIXED] Converts a query which uses exists/not exists to a three table join

Issue I am working on a problem statement where I need to retain records based on a logic which is …

[FIXED] Update column value of a table when the value of another table changes

Issue I have 3 tables ( Inventory , OrderMaster , OrderDetail ). In the table Inventory I have ID_…

[FIXED] How to get character input at runtime from a procedure in PL/SQL

Issue I want to convert Canadian dollars to other currencies with some convention. I am creating a …

[FIXED] PL/SQL - Nested if else if syntax

Issue I'm developing a trigger in PL/SQL. It has this building structure: if a = 1 then i…

[FIXED] Oracle CONSTANT from query in package

Issue This is my CONSTANT in package. const_percent CONSTANT NUMBER DEFAULT 0.3; Is it possible …

[FIXED] Fill variable from query in Oracle Package

Issue I want populate variable from query in oracle package. In package I'm define: g_my_v…

[FIXED] 'expression is of wrong type' error while calculating difference between two dates in oracle

Issue I am trying to calculate difference between two dates and display the difference as days in t…

[FIXED] Bulk collection in oracle

Issue I have bulk collected data in T_USERRECORD through Cursor. Now inside T_USERRECORD loop I hav…

[FIXED] Oracle SQL, Date and Time in GMT (UTC)

Issue This coding is giving the correct answer for SYSDATE select round((SYSDATE - date '1970-…

[FIXED] oracle dbms_scheduler repeat_interval

Issue I have a procedure named MY_PROCEDURE_X in a packaged MY_PACKAGE_X. My requirement is that th…

[FIXED] PL/SQL Cursor whose query is based on a variable

Issue I've got a PL/SQL block that's basically DECLARE PIDM NUMBER(8); …

[FIXED] How to put a values in assigned space inside a string from other table

Issue I've two tables. Name of first is, let's say, Table_A: class="s-table">…

[FIXED] Remove Duplicate nested phrases from a string with Oracle Regexp_replace

Issue as part of a PL/SQL script, we are setting a Varchar variable called 'V_COMMENT' as s…

[FIXED] Counting nulls for each column in table

Issue We want to count how many nulls each column in a table has. There are too many columns to do …

[FIXED] Oracle enforce SYSDATE to PT

Issue I have a database for which I want to enforce SYSDATE to be Pacific Time. I cannot modify the…

[FIXED] end-of-file error occur while creating a procedure in oracle

Issue I am new to oracle database. I use oracle database 19c. I try to create a procedure by declar…