<% Dim SQl, objdb set Objdb = Server.CreateObject("ADODB.Recordset") Dim gubun : gubun = request("gubun") Dim eNo : eNo = request("E_No") Dim IDKey : IDKey = request("IDKEY") Dim flag select case gubun case "List" DBConnect() SQL = "" SQL = SQL&" select a.*, case isnull(b.Status,'') when '1' then '진행중' when '11' then '수정가능' when '10' then '완료' else '미진행' end as status from [No.6].krc_survey.dbo.Dat_2002020_B_exit a "&VbCrlf SQL = SQL&" left join [No.6].krc_survey.dbo.Dat_2002020_B b on a.id=case when CHARINDEX('_', b.IDKey)<>0 then LEFT(b.IDKey, CHARINDEX('_', b.IDKey)-1) end where a.flag='1' "&VbCrlf 'response.write SQL Objdb.Open SQL,DBConn,3,1,1 If not objdb.eof Then while not objdb.eof response.write ""&VbCrlf response.write " "&objdb("Q1")&""&VbCrlf response.write " "&objdb("cluster_nm")&""&VbCrlf response.write " "&objdb("Q4")&""&VbCrlf response.write " "&objdb("Q3")&""&VbCrlf response.write " "&objdb("Q10")&""&VbCrlf response.write " "&objdb("pre_name")&""&VbCrlf response.write " "&objdb("pre_phone")&""&VbCrlf response.write " "&objdb("status")&""&VbCrlf response.write ""&VbCrlf objdb.movenext wend End If DBClose() case "json_list" DBConnect() SQL = "" SQL = SQL & " SELECT e_subarea_cd " & VbCrlf SQL = SQL & " ,e_subarea_nm " & VbCrlf SQL = SQL & " ,e_exit_cd " & VbCrlf SQL = SQL & " ,e_full_it " & VbCrlf SQL = SQL & " ,e_it " & VbCrlf SQL = SQL & " ,ex_cd " & VbCrlf SQL = SQL & " ,cluster " & VbCrlf SQL = SQL & " ,e_exit_nm " & VbCrlf SQL = SQL & " ,e_full_nm " & VbCrlf SQL = SQL & " ,e_full_ad " & VbCrlf SQL = SQL & " FROM exitpoll.dbo.R_Exit " & VbCrlf SQL = SQL & " WHERE Flag = 1 " & VbCrlf SQL = SQL & " FOR JSON PATH " & VbCrlf Objdb.Open SQL,DBConn If Not Objdb.EOF Then Do While Not Objdb.EOF Response.Write Objdb(0) Objdb.MoveNext Loop Else Response.Write "[]" End If DBClose() case "confirm" If IDKey <> "" Then SQL = "Update krc_survey.dbo.dat_2002020_B set status='10' where Idkey= '"&IDKEY&"'" flag = ExecuteSQL1(SQL) Else flag = false End If response.write flag End Select %>