0
I need to help solve a problem,
Code:
DELIMITER $$
create procedure sp_ptopedido( TPOMEDIOREPOS int, DEMANDA int, ESTOQUEMINIMO int),
begin
PONTOPEDIDOTOPEDIDO = ((TPOMEDIOREPOS / 30) * DEMANDA) + ESTOQUEMINIMO FROM produto;
END $$
DELIMITER ;
I get this error when executing the command:
SQL command:
create procedure sp_ptopedido( TPOMEDIOREPOS int, DEMANDA int, ESTOQUEMINIMO int),
begin
PTOPEDIDO = ((TPOMEDIOREPOS / 30) * DEMANDA) + ESTOQUEMINIMO FROM produto;
END
Mysql Messages : Documentation
#1064 - You have an error in your SQL syntax; check the manual that Corresponds to your Mariadb server version for the right syntax to use near ' Begin
PTOPEDIDO = ((TPOMEDIOREPOS / 30) * DEMANDA) + ESTOQUEMINIMO ' at line 1
Ola Maria, you could be more specific about the problem, explain more about it and add more details, it would help. Make a tour also to learn how the site works.
– gato
oi Dener, this precedent would do this calculation:Order Point = [(Replacement Time/30) * Demand] + Minimum Stock.
– Maria
Then I tried to make that code, but it’s making a mistake.
– Maria
the fields DEMAND, STOCK AND TPOMEDIOREPOS are from the same table, products.
– Maria
Which error is giving? Could edit the question and put the errors?
– gato
Which language is also used?
– gato
Mysql, I’m doing in phpMyAdmim
– Maria
There is an extra comma after the "(" of create Procedure. Furthermore, you do nothing with this routine other than assign a value to a non-existent variable (PTO request) and return nothing to anyone. This trial, inclusive, seems to me totally unnecessary to accomplish something so simple, probably what you want to do is run an UPDATE. If you edited the question explaining your problem, you could get better help.
– Loudenvier