Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Problem
Hi
I'm a french student, i must create some PL/SQL procedure and function. I'm using SQL Server 8.0 on a UNIX system (HP-UNIX).
If you enter for example 'my dog', it will write my dog(14 blanks) ' is a good PL/SQL programmer ;) How to remove the 14 blanks and have this my dog is a good PL/SQL programmer :)
3)Cursor question
create or replace procedure aff_tableservie (pnumserv serveur.numserv%TYPE,
pdate DATE) as
cursor c1 is select numtable from affecte where numserv = pnumserv and
datejour = pdate;
begin
for rec in c1 loop
dbms_output.put_line('Le serveur ' || pnumserv || 'a servi la table ' ||
rec.numtable || 'le ' ||
to_char(rec.datejour,'DD/MM/YYYY');
end loop;
end;
Is the "for in c1 loop" read all data in the cursor? If there is no data in the cursor, where do i put the exception in order to display a message.
4) Another cursor question
Here is a cursor
cursor c2 is select sum(montant) from commande where
to_char(datecom,'MM')=pmois group by to_char(datecom,'DD');
To read the entire cursor
for rec in c2 loop
end loop;
How to access to the sum(montant)?
Which one is correct(hope there is one ;))
rec.montant or rec.sum(montant)
Thanks a lot.
Sydney
Received on Mon May 10 1999 - 11:47:06 CDT
![]() |
![]() |