Board index » delphi » Parameterized Queries

Parameterized Queries

Is there a reason why a parameter can only be used once within a sql
statement?

Example:

strSQL := 'update user_table set user_name1=:PARAM1, user_name2=PARAM1';

Just curious.

Thanks,
Jeff

 

Re:Parameterized Queries


I think it's just a bug
Quote
"Jeff Cope" <JeffC...@lllow.com> wrote in message news:3b573164_2@dnews...
> Is there a reason why a parameter can only be used once within a sql
> statement?

> Example:

> strSQL := 'update user_table set user_name1=:PARAM1, user_name2=PARAM1';

> Just curious.

> Thanks,
> Jeff

Re:Parameterized Queries


Hi, Jeff!

If this is the exact text of your query, then Param1 in the second statement
is directly intepreted as a value, not an alias. You have forgotten the ':'
in front of Param1. I am not sure if this solves your problem (in fact I
don't even know what your query returns), but anyway.

//Bent Arne Blegen

Quote
"Jeff Cope" <JeffC...@lllow.com> wrote in message news:3b573164_2@dnews...
> Is there a reason why a parameter can only be used once within a sql
> statement?

> Example:

> strSQL := 'update user_table set user_name1=:PARAM1, user_name2=PARAM1';

> Just curious.

> Thanks,
> Jeff

Other Threads