Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Question w/code attch

Re: PL/SQL Question w/code attch

From: Leonel Sanhueza <lsanhuez_at_udec.cl>
Date: Thu, 01 Oct 1998 20:27:43 -0400
Message-ID: <36141DFD.C66A8E30@udec.cl>


Hello,
You must eliminate the ":" in de asignation variable "busyHour" INSERT INTO tblBUSYHOUR VALUES(:busyHour);

If you want to print messages with DBMS_OUTPUT.PUT_LINE, you must do SQL> set serveroutput on
SQL> exec BBusyHour(...);

this messages only appear in Sqlplus, Sqldba and not sure if ProcedureBuilder

Leonel Sanhueza J.
Universidad de Concepcion
lsanhuez_at_udec.cl

Robert Ogren wrote:

> I have having trouble getting this code to insert the "record" into a
> table.
> I have not used a lot of the PL/SQL. Current Version O8.0.4 SQL
>
> I get the problem oon the INSERT LINE
> the Error I get is BAD BIND VARIABLE BUSYHOUR
>
> The other wierd thing is that the DBMS_OUTPUT.PUT_LINE doesn't send
> anything to the screen.
>
> Thanks for any information
>
> Rob
>
> -------
>
> CREATE OR REPLACE PROCEDURE BBusyHour(
> p_CurrentDate IN tblDayEcell.timeperiod%TYPE
> )
> IS
>
> currentHour CHAR(5);
> currentDate CHAR(10);
> selectDate CHAR(19);
> currentNetID NUMBER;
> counter NUMBER;
>
> BEGIN
>
> DECLARE
> TYPE sTimes_t IS VARRAY(48) of CHAR(5);
>
> TYPE busyrecord IS RECORD (
> timep CHAR(19),
> netid NUMBER(6,0),
> hold3 NUMBER(6,0),
> hold6 NUMBER(6,0),
> dispatch NUMBER(6,0),
> control NUMBER(6,0)
> );
>
> busyHour busyrecord;
>
> sTimes sTimes_t := sTimes_t('00:00', '00:30', '01:00', '01:30',
> '02:00', '02:30', '03:00', '03:30', '04:00',
> '04:30', '05:00', '05:30', '06:00',
> '06:30', '07:00', '07:30', '08:00', '08:30',
> '09:00', '09:30', '10:00', '10:30',
> '11:00', '11:30', '12:00', '12:30', '13:00',
> '13:30', '14:00', '14:30', '15:00',
> '15:30', '16:00', '16:30', '17:00', '17:30',
> '18:00', '18:30', '19:00', '19:30',
> '20:00', '20:30', '21:00', '21:30', '22:00',
> '22:30', '23:00', '23:30');
>
> currentDate := p_CurrentDate;
> selectDate := currentDate || currentHour;
>
> FOR counter IN 1..sTimes.COUNT
>
> LOOP
> BEGIN
>
> SELECT timeperiod,network_id,t_tch_hold_times_3,
> t_tch_hold_times_6, d_tch_hold_times,t_dcch_hold_times
> INTO busyHour
> FROM tblDayEcell ecell
> WHERE ecell.timeperiod = selectDate;
>
> EXCEPTION
> WHEN NO_DATA_FOUND THEN
> NULL;
> END;
>
> DBMS_OUTPUT.PUT_LINE(sTimes(counter));
> DBMS_OUTPUT.PUT_LINE(counter);
>
> INSERT INTO tblBUSYHOUR VALUES(:busyHour);
>
> selectDate := currentDate || sTimes(counter);
>
> END LOOP;
>
> END;
> END;
Received on Thu Oct 01 1998 - 19:27:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US