Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: problems with functions and forms

    We are learning oracle 8i form builder. We have tables named products, suppliers and shopping_chart.
    We have a form which shows one supplier at the time and all of itīs products.
    We have button after every product which inserts that product to the shopping_chart table.

    In the suppliers table we have supplier_id as a primary key and supplier_name,
    in the products table we have product_id as a primary key, product_name, price and supplier_id as a foreign key.
    In the shopping_chart table we have chart_id as a primary key, supplier_id and product_id as foreign keys.

    Now we are trying to do a form which shows the products and suppliers that are in the shopping_chart table.
    We have functions GetProduct, GetPrice and GetSupplier. Product_name and price shows well,
    but we canīt get suppliers name to show.
    GetSupplier function looks like this

    FUNCTION GetSupplier(
    pSupplier_id in suppliers.supplier_id%type)

    RETURN varchar2 IS

    name varchar2(50);

    select supplier_name into name from suppliers, products
    where pSupplier_id=suppliers.supplier_id and
    return name;
    exception when no_data_found then null;

    When we run the form it says FRM-40735:FORMULA CALCULATION trigger raised unhandled exception ORA-06503.
    After this there comes one product at the time visible to the shopping_chart form if we push the next record button.

    These might be very silly questions, but we canīt get anywhere with this so we are very greatful if somebody could help us.
    Thanks a lot.

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 4
    Your function did NOT return any value and, therefore, raised an exception.
    Rewrite EXCEPTION code in your function so that is looks like

    RETURN ('No name found');

    In that case, you should not receive an error message (but supplier's name won't be populated as you'd prefer ).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts