Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:51:00+00:00 2026-06-15T19:51:00+00:00

I need to get the output in uu in accordance with value passed through

  • 0

I need to get the output in uu in accordance with value passed through the prompt

create or replace procedure chklg( uu out logn.username%TYPE
                                 , pass in logn.password%TYPE)
is
begin
select username into uu from logn where password=pass;
end; 

I tried executing the above procedure this way:

begin 

chklg(:pass);

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:51:01+00:00Added an answer on June 15, 2026 at 7:51 pm

    By definition a procedure doesn’t return anything. You’re looking for a function.

    create or replace function chklg ( p_pass in logn.password%TYPE
              ) return varchar2 is -- assuming that logn.username%TYP is a varchar2
    
       l_uu logn.username%type;
    
    begin
       select username into l_uu from logn where password = p_pass;
       return l_uu;
    -- If there-s no username that matches the password return null.
    exception when no_data_found then
       return null;
    end; 
    

    I’m slightly worried by this as it appears as though you’re storing a password as plain text. This is not best practice.

    You should be storing a salted and peppered hash of your password next to the username, then apply the same salting, peppering and hashing to the password and select the hash from the database.

    You can execute the function either of the following two ways:

    select chklg(:pass) from dual
    

    or

    declare
       l_pass logn.password%type;
    begin
       l_pass := chklg(:pass);
    end;
    /
    

    To be complete Frank Schmitt has raised a very valid point in the comments. In addition to you storing the passwords in a very dangerous manner what happens if two users have the same password?

    You will get a TOO_MANY_ROWS exception raised in your SELECT INTO .... This means that too many rows are returned to the variable. It would be better if you passed the username in as well.

    This could make your function look something like the following

    create or replace function chklg ( 
             p_password_hash in logn.password%type
           , p_username in logn.username%type
              ) return number
    
       /* Authenticate a user, return 1/0 depending on whether they have
          entered the correct password.
          */
    
       l_yes number := 0;
    
    begin
    
       -- Assumes that username is unique.
       select 1 into l_yes 
         from logn
        where password_hash = p_password_hash
          and username = p_username;
    
       return l_yes;
    
    -- If there-s no username that matches the password return 0.
    exception when no_data_found then
       return 0;
    end; 
    

    If you’re looking to only use a procedure (there’s no real reason to do this at all as it unnecessarily restricts you; you’re not doing any DML) then you can get the output parameter but you have to give the procedure a parameter that it can populate.

    In your case it would look something like this.

    declare
       l_uu logn.username%type;
    begin 
       chklg(l_uu, :pass);
       dbms_output.put_line(l_uu);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the current volume of the output to the sound card.
I need to get some external data to form an output file name in
I am able to get the output format that I need, but not the
I have two tables with a weak relation. I need get a text value
I need to get output of native application under PowerShell. The problem is, output
I need to get the output of ExceptionDescribe() in JNI as string so I
I have input.txt 1 2 3 4 5 I need to get such output.txt
I have below 2 Tables I need to get output witout temp tables WorkItem
I need to get the output (displayed data) from a Java Console App to
I need to get the output of a wget call inside an aw k

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.