On 5-1-2018 14:35, m_brahi...@yahoo.fr [firebird-support] wrote:
> 
> 
> Now with
> 
> V1=:V1 || ' WHERE CF.DATE_COMMANDE'||' BETWEEN '''||:FROM_DATE||''' AND 
> '''||:TO_DATE||'''';
> 
> It works for me  and I tried with
> 
> V1=:V1 || ' WHERE CF.DATE_COMMANDE>='''||:FROM_DATE||''' AND 
> CF.DATE_COMMANDE<='''||:TO_DATE||'''';
> 
> It works too. In which case this isn't the right solution ?

It works, but you should not be using execute statemen. Using for select 
.... should work just fine.

In your case, execute statement only adds overhead and removes compile 
time syntax checking and makes it easier to make mistakes and harder to 
spot them.

Changing this to use for select would simplify your code, as you would 
not be dealing with string concatenation, and you get a compile time 
syntax check in return.

Mark
-- 
Mark Rotteveel
  • [firebird-supp... m_brahi...@yahoo.fr [firebird-support]
    • Re: [fire... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
      • Re: [... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
    • [firebird... Köditz, Martin martin.koed...@it-syn.de [firebird-support]
      • Re: [... Svein Erling Tysvær setys...@gmail.com [firebird-support]
      • Re: [... m_brahi...@yahoo.fr [firebird-support]
        • R... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
          • ... m_brahi...@yahoo.fr [firebird-support]
            • ... m_brahi...@yahoo.fr [firebird-support]
            • ... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
              • ... m_brahi...@yahoo.fr [firebird-support]

Reply via email to