[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Passing a Variable Value as an Expression String toDECODE(), is it possible?
- Subject: RE: [sqr-users] Passing a Variable Value as an Expression String toDECODE(), is it possible?
- From: "Alexander, Steven" <Steven.Alexander@sanjoseca.gov>
- Date: Fri, 8 Sep 2006 13:44:56 -0700
- Delivery-date: Fri, 08 Sep 2006 16:47:45 -0400
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
Sorry, I missed this: I don't think TRIM is a SQL function or an SQR
function. There's LTRIM and RTRIM in SQL and in SQR, but not TRIM.
-----Original Message-----
From: Alexander, Steven [mailto:Steven.Alexander@sanjoseca.gov]
Sent: Friday, September 08, 2006 12:32 PM
To: 'This list is for discussion about the SQR database
reportinglanguagefrom Hyperion Solutions.'
Subject: RE: [sqr-users] Passing a Variable Value as an Expression String
toDECODE(), is it possible?
In order to use a variable in place of an expression, put square brackets
around it:
max (decode(bl.abbreviation,
TRIM([$ISO_ABBREVIATION]),'Y',bl.abbreviation,'N'))
(,+5)
-----Original Message-----
From: Saffiulla Mohamed [mailto:mohigro@gmail.com]
Sent: Friday, September 08, 2006 12:20 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] Passing a Variable Value as an Expression String
toDECODE(), is it possible?
My apologies in advance - I'm the quintessential SQR newbie.
That being said, I was hoping to receive assistance w/ the following:
I'm having trouble using a variable value as the expression string in a
decode statement.
This works perfectly fine when I supply a static expression string, however,
when I try to make the
code more dynamic, the pattern no longer matches. For example
STATIC EXAMPLE:
...
max (decode(bl.abbreviation, 'FR','Y',bl.abbreviation,'N')) (,#FIRST_POS)
max (decode(bl.abbreviation, 'IT','Y',bl.abbreviation,'N')) (,#POS1)
max (decode(bl.abbreviation, 'GE','Y',bl.abbreviation,'N')) (,#POS2)
max (decode(bl.abbreviation, 'ES','Y',bl.abbreviation,'N')) (,#POS3)
...
That works fine, I'm using a two letter ISO language abbreviation.
Now if I try to do this dynamically, my pattern no longer appears as a
match, and I always return 'N'
DYNAMIC EXAMPLE:
I have an array of language data, one element of which contains the ISO
abbreviation. I use the a variation of the above
but in a loop
...
LET $ISO_ABBREVIATION =
UPPER(LANG_COL_ARRAY.ABBREVIATION(#PRINT_TRANSLATION_DETAIL_COUNTER))
max (decode(bl.abbreviation,
TRIM($ISO_ABBREVIATION),'Y',bl.abbreviation,'N'))
(,+5)
...
I've tried numerous variations of the immediately above line, but still the
pattern fails to match. I'm assuming it must have something to do with
char/string types and or conversion variances...but at this point i'm lost
and could use some advise!
Any direction would be greatly appreciated!!
thank you!!
_______________________________________________
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