Re: PL/SQL script...

From: Corto Maltese <corto_at_castel.nl>
Date: Fri, 15 Dec 2000 22:04:58 GMT
Message-ID: <91e4i7$lum$1_at_nnrp1.deja.com>


Have fun, keep laughing..... ;-)

Thanks for yout tips!

CM.

In article <91drl5$3tj81$4_at_ID-62141.news.dfncis.de>,   "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
> If you request help please provide platform and version info, and the
> *exact* error message. Your assertion dbms_output doesn't work is
 very hard
> to believe, probably we really need to laugh, as most likely you never
> issued set serveroutput on.
>
> Regards,
>
> Sybrand Bakker, Oracle DBA
>
> "Corto Maltese" <corto_at_castel.nl> wrote in message
> news:91ddos$11t$1_at_nnrp1.deja.com...
> > Guys,
> >
> > Don't laugh on me but I have a quite dumb and annoying problem:
> >
> > The following script is inserting the rows at the insert statement
 but,
> > more important, I need to display the records.
> > The insert was done to see if it was working, It did, should not be
> > there.
> > I want to display all records that are matching the loop with the
> > dbms_output line (the only possible to display data so far I know).
> > I have tried the dbms_output statement in many ways but didn't work
> > either.
> >
> > Any thoughts, please help...
> >
> > CM.
> >
> >
> > -- WHENEVER SQLERROR EXIT FAILURE;
> > DECLARE
> >
> > v_xzx varchar2(2);
> >
> > CURSOR cs_prods is
> > select msi.inventory_item_id,
> > msi.segment1
> > from mtl_system_items msi
> > where msi.organization_id = 7
> > and msi.inventory_item_status_code = 'Active'
> > and msi.customer_order_enabled_flag = 'Y'
> > ;
> >
> > cs_item_id mtl_system_items.inventory_item_id%type;
> > cs_item_num mtl_system_items.segment1%type;
> > l_item_id mtl_system_items.inventory_item_id%type;
> > l_item_num mtl_system_items.segment1%type;
> > l_open_qty number;
> > l_onhand_qty number;
> >
> > BEGIN
> >
> > OPEN cs_prods;
> >
> > LOOP
> >
> > FETCH cs_prods INTO
> > cs_item_id,
> > cs_item_num;
> >
> > EXIT when cs_prods%NOTFOUND;
> >
> > BEGIN
> >
> > select sum(moq.transaction_quantity)
> > into l_onhand_qty
> > from mtl_onhand_quantities moq
> > where moq.organization_id = 2
> > and moq.inventory_item_id = cs_item_id
> > and moq.subinventory_code = 'Finish'
> > group by moq.inventory_item_id;
> >
> > exception
> > when no_data_found then
> > l_onhand_qty := 0;
> >
> > END;
> >
> > insert into items_stocks
> > (item_id,
> > product_number,
> > quantity_ordered)
> > values (cs_item_id,
> > cs_item_num,
> > l_onhand_qty);
> > commit;
> >
> > dbms_output.put_line
> > ('stock: '||cs_item_id||cs_item_num||l_onhand_qty);
> >
> > END LOOP;
> >
> > close cs_prods;
> >
> >
> > END;
> > /
> > -- exit;
> > $
> >
> >
> > Sent via Deja.com
> > http://www.deja.com/
>
>

--




Sent via Deja.com
http://www.deja.com/
Received on Fri Dec 15 2000 - 23:04:58 CET

Original text of this message