This commit is contained in:
narawat lamaiin
2024-10-14 10:26:08 +07:00
parent 4ef968b86e
commit 8ceea33218
3 changed files with 10 additions and 14 deletions

View File

@@ -644,7 +644,7 @@ function SQLexecution(executeSQL::Function, sql::T
else
error("Error, SQL execution failed because it does not ended with ';'")
end
println("~~~ SQL ", @__FILE__, " ", @__LINE__)
println("~~~ SQLexecution() SQL: ", @__FILE__, " ", @__LINE__)
println(sql)
result = executeSQL(sql)
@@ -666,19 +666,16 @@ function SQLexecution(executeSQL::Function, sql::T
df
end
println("~~~ SQLexecution() ", @__FILE__, " ", @__LINE__)
println("~~~ SQLexecution() result: ", @__FILE__, " ", @__LINE__)
println(df1)
return (result=df1, success=true, errormsg=nothing)
catch e
println("~~~ Error SQLexecution() 2 ", @__FILE__, " ", @__LINE__)
io = IOBuffer()
showerror(io, e)
errorMsg = String(take!(io))
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
println(errorMsg)
println("~~~ Error SQLexecution() 2.1 ", @__FILE__, " ", @__LINE__)
response = (result=nothing, success=false, errormsg=errorMsg)
println("~~~ Error SQLexecution() 2.2 ", @__FILE__, " ", @__LINE__)
return response
end
end