?
Solved

SQL / BI Publisher

Posted on 2014-08-14
3
Medium Priority
?
163 Views
Last Modified: 2014-09-14
Hi,

I am trying to create a SQL statement to use in word / BI Publisher to display text if the criteria is met, the code I have is not working,

If rate code = ABC1 or RAB2 or ABC3 or BCD1, display TEXT.

Code:
<?If: RATE_CODE='ABC1' or contains
(RATE_CODE,'RAB2')='true' or
RATE_CODE='ABC3' or  RATE_CODE='BCD1'?>
0
Comment
Question by:hellblazeruk
  • 2
3 Comments
 
LVL 16

Expert Comment

by:Swadhin Ray
ID: 40261280
>> If rate code = ABC1 or RAB2 or ABC3 or BCD1, display TEXT.

Is the text is another column ?

We can do something like below:
create table sample_test
(RATE_CODE varchar2(10),
text varchar2(10));


begin
insert into sample_test values('ABC1', 'text1');
insert into sample_test values('RAB2', 'text2');
insert into sample_test values('ABC3', 'text3');
insert into sample_test values('BCD1', 'textbcd1');
insert into sample_test values('Hello', 'Hello');
commit;
end;


select (case when RATE_CODE = 'ABC1' then text
 when RATE_CODE = 'RAB2' then text
 when RATE_CODE = 'ABC3' then text
 when RATE_CODE = 'BCD1' then text
 else'NA'end ) My_val
  from sample_test; 
  
  

Open in new window

0
 

Accepted Solution

by:
hellblazeruk earned 0 total points
ID: 40262043
The code

<?If: RATE_CODE='ABC1' or contains
(RATE_CODE,'RAB2')='true' or
RATE_CODE='ABC3' or  RATE_CODE='BCD1'?>

is very close but not working, the text is inserted using conditional formatting in word
0
 

Author Closing Comment

by:hellblazeruk
ID: 40321506
Solution not working
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question