r/plsql • • Aug 24 '11

Discussion of the controversy that is PL/SQL. Can an entire language be bad practice? I think not.

Thumbnail
ora-00001.blogspot.com
3 Upvotes

r/plsql • • Jul 23 '11

The PL/SQL Bible. If you work with PL/SQL, this reference is invaluable.

Thumbnail
amazon.com
3 Upvotes

r/plsql • • May 24 '25

Oracle PLSQL Tutorial 43- View in Oracle PLSQL with Example | Simple and FORCE View

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Apr 30 '25

Difference between %ROWTYPE and %TYPE in Oracle PLSQL

Post image
2 Upvotes

r/plsql • • Apr 26 '25

IF STATEMENT in Oracle PLSQL

Thumbnail
javainhand.com
2 Upvotes

r/plsql • • Apr 26 '25

Difference Between RANK and DENSE_RANK In Oracle SQL

Thumbnail
javainhand.com
2 Upvotes

r/plsql • • Jan 13 '25

Oracle PLSQL Tutorial 42- Before and After Trigger in PLSQL #PL/SQL #ora...

Thumbnail
youtube.com
2 Upvotes

r/plsql • • Oct 28 '24

Difference Between Statement Level and Row Level Trigger in PLSQL

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Sep 07 '24

Oracle PLSQL Tutorial 40- ROW Level Trigger in Oracle PLSQL #plsql

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Jul 03 '24

Oracle PLSQL Tutorial 37- Package Part -2 with Example in PLSQL

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Jun 15 '24

Oracle PLSQL Tutorial 36- Package Part -1 with Example in PLSQL

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Jun 09 '24

PRAGMA EXCEPTION_INIT with Example in PLSQL

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Jun 01 '24

Oracle PLSQL Tutorial 34- RAISE_APPLICATION_ERROR with Example in PLSQL

Thumbnail
youtu.be
2 Upvotes

r/plsql • • May 03 '24

Parameter Modes in Procedure(IN,OUT,INOUT) with Example

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Mar 30 '24

Function Output (OUT) Parameter in PLSQL with Example

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Feb 10 '24

Nested If Statement in PL/SQL with Example

Thumbnail
youtu.be
2 Upvotes

r/plsql • • Apr 03 '23

Nesting loops

2 Upvotes

So I'm studying plsql and I had I thought experiment that I'm trying to think through. Say I wanted to make a loop to create a print of all days of the calendar year. The outer loop would iterate the months while the inner loop would iterate the days. What makes this thought experiment difficult is that you'd have to define each month by its correct number of days like January has 31 days, February has 28 days and so on and I'm not sure how to articulate this. I imagine this being in a for loop from 1..12 and the inner loop would count up from 1 to the number of days in each month. My first attempt looked something like this:

DECLARE

v_day NUMBER := 1;

BEGIN

FOR v_month IN 1..12 LOOP

dbms_output.put_line('My outer value is : ' || v_month);

LOOP

v_inner := v_inner + 1;

dbms_output.put_line(' My inner value is : ' || v_day);

when v_month := [1,3,5,7,8,10,12]

exit when v_day = 31;

when v_month in 4,6,9,11

exit when v_day = 30;

when v_month = 2

exit when v_day = 28;

END LOOP;

END LOOP;

END;

Does anyone have a solution?


r/plsql • • Oct 02 '22

PL/SQL and version control software

2 Upvotes

Recently I programming PL/SQL in my job, but we don't use any VCS to coding. Anyone know a solution to do that ? Genarally heppen someone overwrite a new feature .


r/plsql • • Sep 04 '22

Git / GitHub workflows

2 Upvotes

I’m on a team of several developers and we currently have zero version control/code review.

Most of us make changes to views directly in the production database and we all have different coding styles.

Our company just recently bought GitHub enterprise and I’m tasked with learning it and recommending/ implementing a workflow that will improve our quality without slowing us down.

Learning git and GitHub seems to be ok. But how do you migrate changes committed in Git to the database?

Open to any tips and suggestions.

Windows 10 SQL Developer 18+ Oracle 19c


r/plsql • • May 20 '22

Comparing two number columns

2 Upvotes

So my query returns values even when the condition is not true, I'm not sure what's going on here

select table_id, total, partial
from table_with_numbers
where total < partial;

I'm getting the results below

1,15,5
2,17,10
3,16,5

Is this normal? Why can't I return the expected result when comparing two columns of numbers?


r/plsql • • May 05 '22

Beyond pl/sql

2 Upvotes

I’ve been doing analytics strictly in pl/sql for the past 10 years. What would be a good add on skill/language to increase my marketability?

What other languages do you use/recommend?


r/plsql • • Mar 08 '22

a little help!

2 Upvotes

i have a Name column and i want to pad every name in it on both the sides like **jack##, **jackson## , **michelle##. using LPAD AND RPAD.


r/plsql • • Feb 10 '22

Difference Between Function and Procedure in PL/SQL

Thumbnail
javainhand.com
2 Upvotes

r/plsql • • Feb 10 '22

Storing select statement in variable - Exact fetch returns more than requested number of rows

2 Upvotes

Hi I'm getting the following error and been stuck on it for a while now can't seem to figure out

Error report - ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 29
01422. 00000 - "exact fetch returns more than requested number of rows"
*Cause: The number specified in exact fetch is less than the rows returned.
*Action: Rewrite the query or change number of rows requested

Declare
    
    -- Variable --
    v_equipType number;
    v_direction number;

    -- Cursors --
    Cursor c_MainLink 
    is 
        Select equipment_id, link_id, node_fr_id, node_to_id, road_name, equipment_type_id ,direction
        From DET_CAM
        where 1=1;
    
    -- Downstream Cursor with parameter --
    Cursor c_downlink (p_dn_node_to_id NUMBER, p_dn_direction NUMBER)
    is
        Select a.node_to_id, a.direction, a.equipment_type_id, a.equipment_id, a.link_id, a.road_name, a.location_id 
        From DET_CAM a
        where 1=1 and  a.node_to_id = p_dn_node_to_id and a.direction = p_dn_direction
        Order by road_name asc, direction asc;
        
    -- Upstream Cursor with parameter --
    Cursor c_uplink (p_up_node_fr_id NUMBER, p_up_direction NUMBER)
    is
        Select a.node_fr_id, a.direction,  a.equipment_type_id, a.equipment_id, a.link_id, a.road_name, a.location_id
        From DET_CAM a
        where 1=1 and a.node_fr_id = p_up_node_fr_id and a.direction = p_up_direction
        Order by road_name asc, direction asc;

Begin
    select equipment_type_id, direction into v_equipType, v_direction from DET_CAM where equipment_type_id = 113 and direction = m_equip.direction;
 
    for m_equip in c_MainLink loop
            for ds_equip in c_downlink(m_equip.node_fr_id, m_equip.direction) loop
                while v_equipType = 113 and v_direction = m_equip.direction loop
                    dbms_output.put_line('Downstream (equip_ID, Link_ID, RN): '||ds_equip.equipment_id||' | '||ds_equip.link_id||' | '||ds_equip.road_name||
                                         ' | Main (equip_ID, Link_ID, RN): '||m_equip.equipment_id||' | '||m_equip.link_id||' | '||m_equip.road_name
                                         );
                end loop;
            end loop;
            for up_equip in c_uplink(m_equip.node_to_id, m_equip.direction) loop
                while v_equipType = 113 and v_direction = m_equip.direction  loop
                    dbms_output.put_line('Main (equip_ID, Link_ID, RN): '||m_equip.equipment_id||' | '||m_equip.link_id||' | '||m_equip.road_name||
                                         ' | Upstream (equip_ID, Link_ID, RN): '||up_equip.equipment_id||' | '||up_equip.link_id||' | '||up_equip.road_name
                                         );
                end loop;
            end loop;
    end loop;
End;

Give a little insight to what I'm trying to achieve here so ya'll get a better idea to what I'm trying to achieve. I've been tasked to Find out what are the Previous or Next block is that has equipment_type_id = 113 with in a network of roads.

Img attached to explain it visually.

Had been given the suggestion to the limit to one result which i'm trying to figure out how I can achieve that and that brings me to the question if i can use parameters within select into statement


r/plsql • • Jan 31 '22

How To Generate Text File in Oracle

Thumbnail
javainhand.com
2 Upvotes