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: procedure won't accept IF

Re: procedure won't accept IF

From: Michelle <michellesihdu_at_hotmail.com>
Date: 20 Oct 2004 00:58:49 -0700
Message-ID: <10de379.0410192358.a6d0332@posting.google.com>


Thanks for a reply.
I have accually tried you suggestion as well. When I do that I get another error, which is even more understandable.

SQL> create or replace package login_info as   2 procedure loginform;
  3 procedure loginform(user IN varchar2, fr_date IN varchar2);   4 end login_info;
  5 /

Paket är skapat.

SQL>
SQL> create or replace package body login_info as   2 procedure loginform is
  3 begin
  4 htp.p('<html><head><title>Kontroll när användarna varit   5 inloggningsstatus</title></head><body>');

  6  htp.p('<h2>Kontroll när användarna varit inloggade</h2>');
  7  htp.p('<form method="GET" action=login_info.loginform>');
  8  htp.p('<p>Fyll i Användarnamn');
  9  htp.p('<p>');
 10  htp.p('<input type="text" maxlength="30" name="user">');
 11  htp.p('<p>fr.o.m datum');
 12  htp.p('<p>');
 13  htp.p('<input type="text" maxlength="30" name="fr_date">');
 14  htp.p('<p>');
 15  htp.p('<input type="submit" value="Skicka">');
 16  htp.p('</form>');
 17  htp.p('</body></html>');

 18 end loginform;
 19
 20 procedure loginform (user IN varchar2, fr_date IN varchar2) is  21 namn varchar2(10);
 22 indate varchar2(10);
 23 startdate varchar2(10);
 24 outdate date;
 25 ddat varchar(10);
 26
 27 CURSOR c2 is
 28      select anv, login_tid, logout_tid into namn, indate, outdate
 29        from anv_log where login_tid >= trunc(to_date(startdate,
 30 'YYYY-MM-DD')) and anv=user;
 31 begin
 32 ddat := fr_date;
 33 startdate := to_date(fr_date, 'YYYY-MM-DD');  34 if ddat is NULL then
 35 htp.p('tjo');
 36 endif;
 37     htp.p('<pre>');
 38     htp.p(startdate);
 39     FOR i IN c2 LOOP
 40     htp.p('user: ' || i.anv ||'  '|| i.login_tid);
 41     END LOOP;
 42     htp.p('</pre>');

 43
 44 end loginform;
 45 end login_info;
 46 /

Varning: Paketstomme skapad med kompileringsfel.

SQL> show err
Fel för PACKAGE BODY LOGIN_INFO:

LINE/COL ERROR

-------- -----------------------------------------------------------------
44/5     PLS-00103: Påträffade symbolen "LOGINFORM" då en av följande
         förväntades:
         if

45/15 PLS-00103: Påträffade symbolen "end-of-file" då en av följande

         förväntades:
         end not pragma final instantiable order overriding static
         member constructor map
--------------------------------------------
I have a swedish installation of oracle in english it'll be something like this:

44/5 Encountered the symbol "LOGINFORM" when one of the following was expected: if

45/15 Encountered the symbol "end-of-file" when one of the following was expected: end not pragma final instantiable order overriding static

         member constructor map

If you have any more ideas I'll be grateful. The fact is that I have been struggling with this problem for about a week now. I thought I would find an answer so I just kept on changing, testing, changing, testing etc.

Regards
/Michelle Received on Wed Oct 20 2004 - 02:58:49 CDT

Original text of this message

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