Completed

Conversão de queries “in line” em queries parametrizadas

Published on the May 26, 2018 in IT & Programming

About this project

Open

Alterar códigos de páginas ASP clássico transformando queries "in line"  em queries parametrizadas (link de vídeo explicativo: https://youtu.be/DTnyufI3WKQ). Ex:

Transformar:
        sSQL = "update tblTabela set "
        sSQL = sSQL & "NM_Nome='" & txtNome & "', "
        sSQL = sSQL & "NM_Curriculo='" & txtCurriculo & "', "
        sSQL = sSQL & "NO_Idade=" & txtIdade & ", "
        sSQL = sSQL & "flag_Ativo='" & selflagAtivo & "' "
        sSQL = sSQL & "where ID_Template=" & id
        sSQL = sSQL & " and NO_CodCli = " & Session("CodCli")
Em:
        sSQL = "update tblTabela set "
        sSQL = sSQL & "NM_Nome=?,"
        sSQL = sSQL & "NM_Curriculo=?,"
        sSQL = sSQL & "NO_Idade=?,"
        sSQL = sSQL & "flag_Ativo=? "
        sSQL = sSQL & "where ID_Template=? "
        sSQL = sSQL & "and NO_CodCli = ? "
        Set cmd = Server.CreateObject("ADODB.Command")
        cmd.ActiveConnection = pobjConn
        cmd.CommandType = adCmdText
        cmd.CommandText =sSQL
        cmd.Parameters.Append cmd.CreateParameter("NM_Nome", adVarChar, adParamInput, 100, txtNome)
        cmd.Parameters.Append cmd.CreateParameter("NM_Curriculo", adLongVarChar, adParamInput, -1, txtCurriculo)
        cmd.Parameters.Append cmd.CreateParameter("NO_Idade", adInteger, adParamInput, , txtIdade)
        cmd.Parameters.Append cmd.CreateParameter("flag_Ativo", adVarChar, adParamInput, 1, selflagAtivo)
        cmd.Parameters.Append cmd.CreateParameter("ID_Template", adInteger, adParamInput, , id)
        cmd.Parameters.Append cmd.CreateParameter("NO_CodCli", adVarChar, adParamInput, 10, Session("CodCli"))

Há arquivos anexos de exemplo.

O trabalho deste projeto prevê quase 800 atualizações de queries, mas será necessário um teste inicial com poucas queries para verificarmos o entendimento, capacitação para execução e qualidade na comunicação.

Category IT & Programming
Subcategory Web development
What is the scope of the project? Medium-sized change
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
Roles needed Developer, Other
Other roles needed Alterar códigos Conforme um padrão pré-estabelecido.

Delivery term: June 02, 2018

Skills needed

ASP

Other projects posted by C. H.