Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

[Error] ORA-25154 (20: 11): PL/SQL: ORA-25154: column part of USING clause cannot have qualifier

2738620Aug 23 2014 — edited Aug 24 2014

Hi,

I am getting the subject error in the following function, the line in red is the offending one :

CREATE OR REPLACE FUNCTION inventory_in_stock (p_inventory_id INTEGER) RETURN BOOLEAN
IS
    v_rentals INTEGER;
    v_out     INTEGER;
BEGIN

    --AN ITEM IS IN-STOCK IF THERE ARE EITHER NO ROWS IN THE rental TABLE
    --FOR THE ITEM OR ALL ROWS HAVE return_date POPULATED

    SELECT COUNT(*) INTO v_rentals
    FROM rental
    WHERE inventory_id = p_inventory_id;

    IF v_rentals = 0 THEN
      RETURN TRUE;
    END IF;

    SELECT COUNT(rental_id) INTO v_out
    FROM inventory LEFT JOIN rental USING(inventory_id)
    WHERE inventory.inventory_id = p_inventory_id
    AND rental.return_date IS NULL;

    IF v_out > 0 THEN
      RETURN FALSE;
    ELSE
      RETURN TRUE;
    END IF;
END;

You help to corrent it will be appreciated.

Many thanks !!

Tonya.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2014
Added on Aug 23 2014
16 comments
7,691 views