5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in I_CUST_ID. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. When the procedure is called it should output the contents of I_CUSTOMER_NAME and I_CREDIT_LIMIT. HERE'S MY QUERY -- create a procedure named GET_CREDIT_LIMIT -- use I_CUST_ID as a input parameter -- use I_CUSTOMER_NAME, I_CREDIT_LIMIT as output parameters -- select columns CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT and store the values in I_CUSTOMER_NAME, I_CREDIT_LIMIT -- using where clause to match the CUST_ID to currently stored in I_CUST_ID(provided as a parameter) DELIMITER // CREATE PROCEDURE GET_CREDIT_LIMIT ( IN I_CUST_ID int, OUT I_CUSTOMER_NAME varchar(75), OUT I_CREDIT_LIMIT decimal(10,2) ) BEGIN SELECT CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT INTO I_CUSTOMER_NAME, I_CREDIT_LIMIT FROM CUSTOMER WHERE CUST_ID = I_CUST_ID; END // DELIMITER ; -- call the procedure GET_CREDIT_LIMIT with CUST_ID 125 CALL GET_CREDIT_LIMIT(125, @I_CUSTOMER_NAME, @CREDIT_LIMIT); SELECT @I_CUSTOMER_NAME, @CREDIT_LIMIT; ERROR 1318 (42000) at line 1: Incorrect number of arguments for PROCEDURE KimTay.GET_CREDIT_LIMIT; expected 3, got 1
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in I_CUST_ID. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. When the procedure is called it should output the contents of I_CUSTOMER_NAME and I_CREDIT_LIMIT. HERE'S MY QUERY
-- create a procedure named GET_CREDIT_LIMIT
-- use I_CUST_ID as a input parameter
-- use I_CUSTOMER_NAME, I_CREDIT_LIMIT as output parameters
-- select columns CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT and store the values in I_CUSTOMER_NAME, I_CREDIT_LIMIT
-- using where clause to match the CUST_ID to currently stored in I_CUST_ID(provided as a parameter)
DELIMITER //
CREATE PROCEDURE GET_CREDIT_LIMIT
(
IN I_CUST_ID int,
OUT I_CUSTOMER_NAME varchar(75),
OUT I_CREDIT_LIMIT decimal(10,2)
)
BEGIN
SELECT CONCAT(FIRST_NAME, ' ', LAST_NAME), CREDIT_LIMIT
INTO I_CUSTOMER_NAME, I_CREDIT_LIMIT
FROM CUSTOMER
WHERE CUST_ID = I_CUST_ID;
END //
DELIMITER ;
-- call the procedure GET_CREDIT_LIMIT with CUST_ID 125
CALL GET_CREDIT_LIMIT(125, @I_CUSTOMER_NAME, @CREDIT_LIMIT);
SELECT @I_CUSTOMER_NAME, @CREDIT_LIMIT;
ERROR 1318 (42000) at line 1: Incorrect number of arguments for PROCEDURE KimTay.GET_CREDIT_LIMIT; expected 3, got 1
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Im still receiveing an error. ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GET_CREDIT_LIMIT with CUST_ID ('125')' at line 1.ERROR 1318 (42000) at line 1: Incorrect number of arguments for PROCEDURE KimTay.GET_CREDIT_LIMIT; expected 3, got 1 tried to use this
- call the procedure GET_CREDIT_LIMIT with CUST_ID 125
CALL GET_CREDIT_LIMIT(125, @I_CUSTOMER_NAME, @CREDIT_LIMIT);
SELECT @I_CUSTOMER_NAME, @CREDIT_LIMIT;
Still not right