Pages

Pages

Write a PL/SQL Cursor to check the user authentication.

Write a PL/SQL Cursor to check the user authentication.

SQL>Create table user(userid varchar2(20),password varchar2(20));

SQL>insert into user
          values(upper(‘&uid’),
          translate(upper(‘&password’),
          ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’,’1234567890!@#$%^&*()-=_+;,.’));

SQL>DECLARE
          cursor primary_cur is
          select ‘X’
          from user
          where userid=upper(‘&uid’) and
          password=Translate(upper(‘&password’),
          ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’,’1234567890!@#$%^&*()-=_+;,.’);
          dummy_var char;
          BEGIN
          open primary_cur;
          fetch primart_cur into dummy_var;
          if primary_cuf%found then
                    display(‘The userid and password corr’);
          else
                    display(‘Unknow userid and password’);
          end if;
          close primary_cur;
          end;

 Click here to go to Back page

No comments:

Post a Comment