
Signature
Hope this helps...
IchBin
__________________________________________________________________________
'Laughter is inner jogging'
- Norman Cousins, editor and author (1915-1990)
>>>> Can anyone point me to some examples of string concatenation in a
>>>> SELECT statement.
[quoted text clipped - 44 lines]
>
> Not sure how technical you want to get...
Thanks Ich Bin,
I am going to look for a solution, although have been looking fo two
days now.
My sql statement woul be something like this:
ResultSet rs = stmt.executeQuery("SELECT Variable1, Variable2 FROM
Variable3");
Just so you know what i am on about. I was trying stuff like this:
"SELECT" + Variable1 + "," + Variable2 + "FROM" +Variable3);
Anyway thanks for responses.
IchBin - 28 Sep 2004 10:46 GMT
>>>>> Can anyone point me to some examples of string concatenation in a
>>>>> SELECT statement.
[quoted text clipped - 56 lines]
> Just so you know what i am on about. I was trying stuff like this:
> "SELECT" + Variable1 + "," + Variable2 + "FROM" +Variable3);
It looks ok except that "FROM" should be " FROM " and "SELECT" should be
"SELECT ".
Now I understand when you say concat.!
Don't confuse SQL and the way that you concate a java string statement
that will be executed by the SQL preprocessor.
> Anyway thanks for responses.
Think you want to try:
String sqlStatement = "SELECT " + Variable1 + "," + Variable2 + " FROM "
+ Variable3);
ResultSet rs = stmt.executeQuery(sqlStatement);
Reason: Just for debugging. If you want to trace and look at the
sqlStatement and how it was built.

Signature
Hope this is a little better help...
IchBin
__________________________________________________________________________
'Laughter is inner jogging'
- Norman Cousins, editor and author (1915-1990)