Nandofjsc 0 Denunciar post Postado Janeiro 8, 2011 Pessoal estou precisando urgente de uma ajuda. Minha situação é a seguinte: Tenho 3 tabelas no meu Banco de dados. CURSO ALUNO MENSALIDADE Minha idéia é a seguinte: Cadastro um Curso ex: id: 1, descricao: Programação de Sistemas, duracao: 6 Agora vem o principal,queroque ao cadastrar um aluno e escolher um curso seja cadastrado automaticamente(seja por Trigger ou Store Procedure) as Mensalidades de acordocom a duração do curso. Ex: Cadastrei o Curso Programação com duraçãode 6(seis meses), quando cadastrar um Aluno sendo o primeiro a id será 1(um) e escolher o curso. Curso id descricao duracao 1 Programação de Sistemas 6 Aluno id nome dnascimento idcurso 1 Fernando José 21/03/1981 1 Ao salvar esse cadastro do aluno ele gerar automaticamente seja por trigger ou storeprog Mensalidades id idaluno idcurso parcela vencimento Varlor 1 1 1 1 05/01/2011 R$ 100,00 2 1 1 2 05/02/2011 ... 3 1 1 3 05/03/2011 4 1 1 4 05/04/2011 5 1 1 5 05/05/2011 6 1 1 6 05/06/2011 aGRADEÇO MUITO SE ALGUÉM PUDER ME AJUDAR. Compartilhar este post Link para o post Compartilhar em outros sites
macielcr7 9 Denunciar post Postado Janeiro 8, 2011 você ja tem algo pronto ? se sim mostre... para podermos ajudá-lo.... isso seria mais para Procedure. Compartilhar este post Link para o post Compartilhar em outros sites
Nandofjsc 0 Denunciar post Postado Janeiro 11, 2011 estou meio perdido... na verdade tenho uma no Delphi, pois fazia isso na aplicação e não no Banco de Dados. for contador := 1 to quantidade do begin TB_Mensalidade.Insert; TB_MensalidadeMAT_ALUNO.value := TB_AlunosMAT_ALUNO.Value; TB_MensalidadePARCELA.Value := CONTADOR; Data := TB_AlunosDATA_CADASTRO.value; TB_MensalidadeVALOR.Value := edtValor.Text; IF contador = 1 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,1); end; IF contador = 2 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,2); end; IF contador = 3 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,3); end; IF contador = 4 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,4); end; IF contador = 5 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,5); end; IF contador = 6 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,6); end; IF contador = 7 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,7); end; IF contador = 8 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,8); end; IF contador = 9 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,9); end; IF contador = 10 then begin TB_MensalidadeDATA_VENCIMENTO.Value := IncMonth(Data,10); end; TB_Mensalidade.Post; Compartilhar este post Link para o post Compartilhar em outros sites