Re: executeQuery Can't pass variable to SQL. :-( Why?

From: Nelson Broat <nelson.broat_at_mail.cuny.edu>
Date: 19 Aug 2003 13:18:02 -0700
Message-ID: <32159d9d.0308191218.a338c3a_at_posting.google.com>


"Dave Milne" <jeep_at__nospam_milne.info> wrote in message news:<jI3Za.1322$Ic.11076832_at_news-text.cableinet.net>...
> Hi Nelson
>
>You have got a <%= nested inside a <% - can't do that.
>I'm afraid I don't understand what you are trying to do, so can't be
of much
>more help. There doesn't seem to be much point in your recordKey
variable -
>you could just do
> String sql = "SELECT * FROM db.db WHERE db.column = 99"
>just as well.
>If you want to keep your variable, then do this:
> String sql = "SELECT * FROM db.db WHERE db.column = " + recordKey ;

Thanks Dave! That was it. I was trying so many different variations that I didn't try the most simplest one of all. :-) Well...actually... I thought I had, but I bet I put that damn quote in the wrong place to start with. Then, of course, I traveled on my tagents while pulling my head out of my hair! :-)

Thanks again,

Nelson Received on Tue Aug 19 2003 - 22:18:02 CEST

Original text of this message