4
votes

I am creating Stored Procedure but get an error.

My Stored Procedure:

Create Procedure Join()
BEGIN
SELECT Orders.orderId, Customers.customerName, Orders.orderDate
FROM Orders
INNER JOIN Customers
ON Orders.CustomerId=Customers.CustomerId;
END

Error Is Below:

Error

SQL query: Documentation

Create Procedure Join() BEGIN SELECT Orders.orderId, Customers.customerName, Orders.orderDate FROM Orders INNER JOIN Customers ON Orders.CustomerId=Customers.CustomerId; END MySQL said: Documentation

1064 - Erreur de syntaxe près de 'Join() BEGIN SELECT Orders.orderId, Customers.customerName, Orders.orderDate ' à la ligne 1

2
Join could be a reserved word, try changing that - Flakes
Thanks For help it's procedure Name give error I change that and problem solve Thanks again guys - KuMaR
Join is reserved word, rename Join to smething else! - Haris

2 Answers

1
votes

Create Procedure User() BEGIN SELECT Orders.orderId, Customers.customerName, Orders.orderDate FROM Orders INNER JOIN Customers ON Orders.CustomerId=Customers.CustomerId; END

0
votes

Try Join() in place of `Join`().