MySQL Forums
Forum List  »  Portuguese

Storede Procedure
Posted by: CARLOS SERGIO DE OLIVEIRA
Date: January 24, 2022 06:12AM

Bom dia!!!

Alguém poderia me auxiliar nesta questão:

Estou precesinando criar uma storede procedure para uma tela de agendamentos, para isso tenho 03 tabelas
Resumindo as tabelas para dicar rapido:

TB_Clientes:
id_cliente, (auto incrimente)
Nome_cliente (Varchar(60))

TB_Horarios
id_horario, (auto incrimente)
horario, (Time)
estatus, (varchar(15)) esse estatus recebe ('livre', ou 'ocupado')

TB_agendamento
id_agendamento, (auto incrimente)
cod_cliente, (int)
cod_horario, (int)
data_agendamento, (Date)


preciso antes de fazer a inclusão na tb_agendamentos, preciso verificar se já existe a data e o horário cadastro,
se não existir far-se a inclusão e altera o campo estatus da tb_horarios para ocupado.

alguem tem uma luz para me dar?

Options: ReplyQuote


Subject
Views
Written By
Posted
Storede Procedure
425
January 24, 2022 06:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.