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 4272538
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:35:28+00:00 2026-05-21T07:35:28+00:00

Currently i have this procedure under package that gets user_name when some selects user_id

  • 0

Currently i have this procedure under package that gets user_name when some selects user_id on web page but now i wanna change the format by adding ssn to the page so when some body selects user_id it loads user name as well as ssn on webpage textbox.. i am using callable statement to load data.. what can i change here to get both user name and ssn

    PROCEDURE get_User_name
  (
    return_code_out OUT VARCHAR2,
    return_msg_out OUT VARCHAR2,
    user_id_in IN user.user_id%TYPE,
    user_name_out OUT user.user_name%TYPE
  )
  IS

  BEGIN


    return_code_out := '0000';
    return_msg_out := 'OK';

    SELECT c.user_name INTO user_name_out 
      FROM user c
     WHERE c.user_id = user_in;

 END get_user_name;

and here is my load function

    public String load() {

        String retMsg = null;
        DbUtil db = null;
        java.sql.CallableStatement cstmt = null;

            try {
            db = new DbUtil();
            cstmt = db.prepareCall("{ call sample.PACK_USER.get_user_name(?, ?, ?, ?) }");

            cstmt.registerOutParameter(1,OracleTypes.VARCHAR);
            cstmt.registerOutParameter(2,OracleTypes.VARCHAR);
            cstmt.setString(3,this.getuserid());
            cstmt.registerOutParameter(4,OracleTypes.VARCHAR);

                cstmt.execute();

            if (cstmt.getString(1).equals(Constants.dbSuccess))
                myLog.log(myLog.INFORMATION, "UserBean.load() DB return code and message = " + retMsg);
            else {
                retMsg =  cstmt.getString(1) + " - " + cstmt.getString(2);
                myLog.log(myLog.ERROR, "UserBean.load() DB return code and message = " + retMsg);
            }

            this.setUserName(cstmt.getString(4));
return retMsg;
    }
  • 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-05-21T07:35:29+00:00Added an answer on May 21, 2026 at 7:35 am

    So that is change your procedure as Rajesh suggested (though it does depend on which database server you are using):

    PROCEDURE get_User_name
    ( user_id_in IN user.user_id%TYPE, 
      user_name_out OUT user.user_name%TYPE,
      user_ssn_out  out user.ssn_type%TYPE ) IS
    
    BEGIN
    
    SELECT c.user_name, c.ssn 
      INTO user_name_out, ssn_out
      FROM user c
      WHERE c.user_id = user_in;
    
    END get_user_name;
    

    AND change the Java code as follows:

            cstmt = db.prepareCall("{ call sample.PACK_USER.get_user_name(?, ?, ?) }");
    
            cstmt.setString(1,this.getuserid());
            cstmt.registerOutParameter(2,OracleTypes.VARCHAR);
            cstmt.registerOutParameter(3,OracleTypes.VARCHAR);
            cstmt.execute();
    
            String userName = cstmt.getString(2);
            String ssnType = cstmt.getString(3);
    

    Your existing error code would never work – you must handle errors by catching an SQLException somewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do not currently have this issue , but you never know, and thought
I have this command that I run every 24 hours currently. find /var/www/html/audio -daystart
There is probably is simple fix for this but I currently have code similar
I'm not sure if this is even possible but here goes: Currently I have
I have a relatively complex .htaccess file to control page requests, this currently redirects
I currently use SQL2008 where I have a stored procedure that fetches data from
Currently i have this method: static boolean checkDecimalPlaces(double d, int decimalPlaces){ if (d==0) return
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
This is what I currently have: CREATE OR REPLACE TRIGGER MYTRIGGER AFTER INSERT ON
I currently have my PHP class variables set up like this: class someThing {

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.