AnsweredAssumed Answered

ExecuteSQL Question

Question asked by dsimonson on Nov 1, 2016
Latest reply on Nov 2, 2016 by fmpdude

I have several ExecuteSQL scripts that I wrote several months ago that just broke.  Here's what happened:


I used to have my "is_deleted" fields be either "T" or "F".  As someone here pointed out to me, there are drawbacks to that approach, and that a better one would be to use 1 or 0.  So I changed all of those fields to 1 or "".


The problem is that my script doesn't seem to be able to recognize "" (empty quotes) as an argument.  Here's the example:


ExecuteSQL( "

SELECT m.pk_med_name_generic

,           SUM (o.med_amt)

,           m.med_units

FROM  ane_ObsMedsT o

JOIN    ane_obsmeds_MEDS m

ON       o.fk_med_id = m.idMedication

WHERE            o.id_anesthetic = ?

AND     o.is_deleted = ?

GROUP BY      m. pk_med_name_generic

,           m.med_units

ORDER BY       m.pk_med_name_generic



; "" ; "" ; $$AnesID; “”)


It worked before when I used "F" instead of "" for the o.is_deleted


Can I use "is NULL" instead of an argument?