Automatization with sql query variables with json and HA variables

hi, good evening, merry christmas i hope everyone its doing fine
im looking for some nice help im a lil noob, but i have made some automatiztions and im still learning, i have been reading testing and trying a lot but im still loss.

im trying to make some kind of emergency button, since the city i live has become a lil bit dangerous and there is nothing like this in the country where i live
i already have tested the notificacion system a ws notificaiton etc etc etc and it works fine i can even send the gps location of a cellphone via ws telegram etc but…
i add to HA my own db of geocode /street reference since gmaps only give me something like 9 street av 2001, and in my country no body understand that we love to use the main and cross street( 9 street av with hellno st)

i have a sqlite db in my HA, that has latitude, longitud, main street, and cross street
i have made some kind of reverse geo code that works for me flawless but…
i want to query and seletc statement on that db but only it when i need it or when i turn on the emergency swith/button
i instaled the sql integration, the sql_json, and i have the sql_web too
my sqlite code start with this

WITH 
  const AS (
    SELECT 
      {{radianes}} AS RADIAN,
      {{cellat}} AS PLAT,
      {{cellon}} AS PLON,
      {{latrad}} AS LAT,
      {{lonrad}} AS LON    
  )
    SELECT calle1,calle2 from calles where nlatitud=LAT and nlogitud=LON

my select statement its around 1100 characters so thats an example
radianes, cellat etc are some variables declared in the automatization/script before the sql query
the select statement has to return calle1 and calle2 so the notification system can send the right address to someone in my family that can help or even the police(im
trying to create a robot call using asterisk for 911 but thats another thing…)
all the examples that i have seen are sql sensors that only read read info but doesnt use variables etc
if some one can helpme i will really apretiate
im sorry for my bad english