ODBiC Discussion Board


Concat SQL statement

by Johan, February 23, 2006 03:28

Hi,

I'm trying to concatenate SQL statements in a loop but don't know if this is possible in ODBIC.

For example (syntax isn't correct, I know):

<% SET input="Europe,Asia Pacific,Greater China" %>

<% SET strSQL = "Select * from table where region = " %>

<% WHILE $input %>

<% SET name = $split(input, ",") %>

<% strConcat = strConcat & '$name$' & "or region = " %>

<% ENDWHILE %>

Output woule be something like: strSQL & strConcat = "Select * from table where region = 'Europe' or region = 'Asia Pacific' or region = 'Greater China'"

Is this possible?

Thanks!



Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.