in Education by
Simple select stored procedure but getting only one column as the result others were getting as null. Can somebody tell me where the error is.. DELIMITER $$ DROP PROCEDURE IF EXISTS `p4`.`get_one_user_new`$$ CREATE PROCEDURE `p4`.`get_one_user_new` ( IN USER_ID INT(11), OUT USER_NAME VARCHAR(255), OUT FIRST_NAME VARCHAR(255), OUT EMAIL VARCHAR(255) ) BEGIN SELECT username,first_name,email INTO USER_NAME, FIRST_NAME, EMAIL FROM p4_users WHERE id = USER_ID; END $$ DELIMITER ; CALL get_one_user_new('4',@USERNAME,@FIRST_NAME,@EMAIL); SELECT @USERNAME,@FIRST_NAME,@EMAIL; JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have a name conflict, you need to make sure your variable names do not clash with your column names. CREATE PROCEDURE `p4`.`get_one_user_new` ( IN PUserid INT(11), OUT PUsername VARCHAR(255), OUT PFirstname VARCHAR(255), OUT PEmail VARCHAR(255) ) BEGIN SELECT username,first_name,email INTO PUsername, PFirstname, PEmail FROM p4_users WHERE id = PUserid; END $$

Related questions

0 votes
    Simple select stored procedure but getting only one column as the result others were getting as null. Can ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    How inserting data through stored procedure do reduces network traffic and increase database performance? (a) ... Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    ____________ is a special type of stored procedure that is automatically invoked whenever the data in the table is ... part 3 topic in portion Transactions of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    You have a column that will only contain values from 0 to 256. What is the most economical data ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    In NoSQL databases, the data can be stored ___________. (1)Multiple times (2)Only once...
asked Apr 21, 2021 in Technology by JackTerrance
0 votes
    I'm attempting to call my sql stored procedure which takes RaceDate as an input and returns Location as an ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm attempting to call my sql stored procedure which takes RaceDate as an input and returns Location as an ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have a stored procedure in SQL 2005. The Stored Procedure is actually creating temporary tables in the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I have a stored procedure in SQL 2005. The Stored Procedure is actually creating temporary tables in the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    I have a stored procedure in SQL 2005. The Stored Procedure is actually creating temporary tables in the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    Which of the following is used to call stored procedure? (a) Statement (b) PreparedStatement (c) CallableStatment (d ... & JDBC of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [ ... not supply any columns. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    which of the following is not a type of stored procedure:- a-system b-input c-remote d-user-defined (Tick the correct option) Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Which of the following is used to call stored procedure? (a) Statement (b) PreparedStatement (c) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What are the advantages of stored procedure?...
asked Dec 17, 2020 in Technology by JackTerrance
...