SQL / BI Publisher

Posted on 2014-08-14
Last Modified: 2014-09-14

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.

<?If: RATE_CODE='ABC1' or contains
(RATE_CODE,'RAB2')='true' or
Question by:hellblazeruk
    LVL 16

    Expert Comment

    by:Swadhin Ray
    >> 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));
    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');
    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


    Accepted Solution

    The code

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

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

    Author Closing Comment

    Solution not working

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
    This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now