[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Passing Variables to Inline Views



That looks good, Rick, but why so bulky?  It's not like we're expecting SQL
or SQR to change the value of $squote.  I'd write it as: let $in_list =
'(''aaa'',''bbb'',''ccc'')'

-----Original Message-----
From: Rick_Creel@aoncons.com [mailto:Rick_Creel@aoncons.com]
Sent: Tuesday, January 07, 2003 2:28 PM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] Passing Variables to Inline Views



I have done something like this and it seems to work fine for me
---------------------------------
let $squote = ''''
let $dynamic_where = ' col5 in ('
let $dynamic_where = $dynamic_where || $squote || 'aaa' || $squote || ','
let $dynamic_where = $dynamic_where || $squote || 'bbb' || $squote || ','
let $dynamic_where = $dynamic_where || $squote || 'ccc' || $squote || ')'


this should yield           $dynamic_where = ' col5 in ('aaa','bbb','ccc')

Then you can have:

(select col1, col2, col3 col4
           from table_c, table_d
           where [$dynamic_where])
---------------------------------



 

                      CARFREH1@nationwi

                      de.com                   To:       sqr-users@sqrug.org

                      Sent by:                 cc:

                      sqr-users-admin@s        Subject:  [sqr-users] Passing
Variables to Inline Views      
                      qrug.org

 

 

                      01/07/2003 05:11

                      PM

                      Please respond to

                      sqr-users

 

 





Here is a problem I am running into right now:

begin-select
.
.
.
from table_a a,
          table_b b,
          (select col1, col2, col3 col4
           from table_c, table_d
           where col5 in $var1) c
where
.
.
.
This will not pass the var1 values ('aaa','bbb','ccc'...) into the inline
view properly as no data is returned. however if a single value is passed:
      where col5 = $var1
It works fine.

I have tried messing with single quotes, [ and ] and [$where] clauses and
none have worked.  Could really use some help at this point.



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users





_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users