Created
May 27, 2026 12:47
-
-
Save wellington1993/0d9d3b734499fb95b14bcd54289483f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ -0,0 +1,16 @@ | |
| Procedure CalcularIMC ( | |
| p_Altura IN Float, | |
| p_Peso IN Float, | |
| p_IMC OUT Float | |
| ); | |
| Version '1.0.0.0'; | |
| Declare | |
| v_AlturaQuad Float; | |
| Begin | |
| v_AlturaQuad := p_Altura * p_Altura; | |
| if (v_AlturaQuad > 0.0) then | |
| p_IMC := p_Peso / v_AlturaQuad; | |
| else | |
| p_IMC := 0.0; | |
| end if; | |
| End; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ -0,0 +1,40 @@ | |
| Procedure BS_IMC_LISTAR_JOVENS ( | |
| p_IdadeLimite IN Int | |
| ) | |
| Returns Table T_ResultIMC ( | |
| tAltura Float, | |
| tPeso Float, | |
| tIMC Float | |
| ); | |
| Version '1.00.00.0003'; | |
| Declare | |
| c_Dados Cursor; | |
| v_Alt Float; | |
| v_Pes Float; | |
| v_IMC Float; | |
| v_Qtd Int; | |
| begin --InternalName: BS_IMC_LISTAR_JOVENS | |
| v_Qtd := 0; | |
| Open c_Dados For | |
| SELECT ALTURA, PESO, IMC | |
| FROM WT_IMC | |
| WHERE IDADE <= p_IdadeLimite; | |
| Fetch c_Dados INTO v_Alt, v_Pes, v_IMC; | |
| While Found(c_Dados) Do | |
| v_Qtd := v_Qtd + 1; | |
| ReturnRow(v_Alt, v_Pes, v_IMC); | |
| Fetch c_Dados INTO v_Alt, v_Pes, v_IMC; | |
| end while; | |
| Close c_Dados; | |
| -- Convers�o expl�cita isola o comando contra a preced�ncia do T-SQL [FATO] | |
| UPDATE ABREV | |
| SET TEXTO = 'Teste Listar. Linhas processadas: ' || Cast(v_Qtd as varchar) | |
| WHERE HANDLE = 1035; | |
| Return NULL; | |
| end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ -0,0 +1,20 @@ | |
| Procedure BS_BENEF_IMC_SYNC ( | |
| p_BenefHandle IN Int, | |
| p_NovoTexto OUT Varchar(100) | |
| ); | |
| Version '1.0.0.0'; | |
| Declare | |
| v_Nome Varchar(100); | |
| begin --InternalName: BS_BENEF_IMC_SYNC | |
| -- Recupera��o de dado mestre do sistema [TRADI��O] | |
| SELECT NOME | |
| INTO v_Nome | |
| FROM SAM_BENEFICIARIO | |
| WHERE HANDLE = p_BenefHandle; | |
| UPDATE ABREV | |
| SET TEXTO = 'Sync efetuado para: ' || v_Nome | |
| WHERE HANDLE = 1035; | |
| p_NovoTexto := 'Sucesso'; | |
| End; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment