Results 1 to 2 of 2

Thread: Can someone look at my code?

  1. #1
    Join Date
    Jul 2009
    Posts
    1

    Can someone look at my code?

    I have 3 tables supports usage of a website. I need a stored procedure to add a new user who currently accessing the website through page pname. The command shows : "Procedure created with compilation errors", can someone point it out my error?
    Create or replace procedure Enter_website
    (u_name in users.u_id%type, page_name in users.pname%type) as
    user_name integer := 0;
    p_found integer :=0;
    begin
    select count(*) into user_name from users where u_id = u_name;
    select count(*) into p_found from page where pname = page_name;

    if (p_found >0) then
    if (user_name =0) then
    insert into users values(u_name, 1, page_name,1 );
    update page
    set total_enter = total_enter+1
    where pname = page_name;
    end if;
    if (user_name > 0) then
    update users
    set ustatus = 1,
    total_visit = total_visit + 1,
    pname = page_name
    where u_id = u_name;
    end if;
    end if;
    end;
    /

    thanks

  2. #2
    Join Date
    Jul 2009
    Posts
    1

    Can some one look at my code?

    Replace as to is in the creation of procedure and try once

Posting Permissions

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