Conditions: SQL Expression vs. PL/SQL expression

In a Condition, what is the difference between a SQL Expression and a PL/SQL expression? The examples shown when creating, say a validation show similar things
example of pl/sql expression: to_char(sysdate,'d')=1
example of sql expression: instr(...) > 0
Arent the 2 expressions above similar? What makes one a sql expression and other a plsql expression?
Thanks

Thanks, but I think its more than a matter of documentation.
I had a SQL expression like
:REQUEST IN ('button1','button2') AND NOT pkg.fn
where pkg.fn is, of course, a packaged function returning BOOLEAN.
The process that this condition was attached to was just not firing. No errors, nothing. I was ready to tear my hair out! I changed the expression type from SQL to PL/SQL and everything was fine.
I think there should be a check in the App Builder for this kind of thing so that such invalid conditions are not allowed to be created.
Thanks

Similar Messages

  • Conditional SQL in Report Query

    How can I code a conditional SQL in the Report query builder
    to include a WHERE clause parameter or not, depending on the value
    of a report parameter? Basically, what I want to do is:
    select field from table where x=1
    <cfif param.a eq 1>and a=1</cfif>
    Report builder does not like this, but I can't find any help
    on how to do this.

    I don't think CFML tags may be used like that in the SQL of
    report query. But then, I'm not very much into reports. If you're
    just out to get the result, then try
    select field from table
    where
    (x=1 and #param.a# <> 1) or (x=1 and #param.a#=1 and
    a=1)

  • How can I delete Conditional Build Expressions in RH7?

    I have a project with some Conditional Build Expression artifacts that I simply cannot get rid of.
    For example, I have created two Conditional Build Expressions:
    Internal OR Foo1
    Foo1 OR Foo2
    It has been determined that the second expression is the one we want.  But, the first one still shows up as an option in the SSL.  Furthermore, when I view a page, the first expression clutters up my list of possible Conditional Build Expressions.
    How can I lose a Conditional Build Expression?  I have quite a few possible arrangements, and I don't want to confuse other authors by having too many choices (especially with similar names).
    Kevin

    Hi Kevin.
    I think you have to do this by manually editing the project's .pss file (projectname.pss). If you take a backup of this file and open it in Notepad you'll find a [Global Build Tag Expressions] section and hopefully in there will be your "Internal OR Foo1" expression preceded with a date/time stamp. If you remove this line it should no longer appear in your project.
    Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
    Follow the RoboColum(n) on Twitter

  • Deleting conditional build expressions

    I have created a project in RH7 and it has expanded to become
    our company's single source for user documentation. This is a good
    thing. However, as I've added information for different audiences,
    I've ended up with a number of conditional build expressions that I
    no longer need. I'd like to delete them so I don't have to search
    through a long list on the WebHelp General screen.
    I've searched the forum and don't see any information about
    deleting conditional build expressions (tags, yes; expressions,
    no). Can anyone tell me how to do this?
    Thanks for your help!

    Dear Mr. Grange,
    Forgive me for resurrecting such an old post. In your reply you state: "any layout that contains the build expression). By 'layout' do you mean the topics?
    Thank you in advance for your assistance.

  • Can't Define Conditional Build Expression

    HI -
    I want to define a couple different Conditional Build
    Expressions to generate print and .chm output, but the Define
    button is dimmed. This feature was working for me a couple days
    ago, but now not.
    In my project I have used the conditional build tags for
    Printed, and in each of the topics where I used it, the red hash
    marks show in the topic - but when I open the conditional build
    tags pod, there is nothing there. Wierd.
    Hmm.. and now RH crashed for the 2nd time in 2 days -
    ugh......
    Any suggestions?
    thanks, Leisa

    Hi Leisa.
    Is this the same project with which you were having problems
    with yesterday? If so, try recreating the build tags exactly as
    they were (e.g. case sensitive) and you will be OK.

  • Table - Conditional SQL possible?

    Application Express 4.1.1.00.23
    Just wondering if the following is possible.
    I have created users and groups,
    for example;
    user1
    user2
    user3
    group1
    group2
    I have assigned the users to the groups as follows;
    Group 1 Members
    user1
    user2
    Group 2 Members
    user3
    In my table I have a column called Visibility values will be either "Internal Only" and "Public".
    Is there a way I can use a conditional query that will do the following;
    if apex_util.current_user_in_group('Group1') then
    Select * from Customer where Visibility = Public
    and
    if apex_util.current_user_in_group('Group2') then
    Select * from Customer where Visibility = Internal Only
    I've been googling the hell out of this, I would generally use PHP and create the page from scratch but I think Apex will be useful if I can learn how to use it!
    Thanks for your time :D

    Create a hidden page item - call it
    P1_VISIBILITYCreate a page Computation for that item of type PL/SQL Function and put there the following code:
    BEGIN
       IF apex_util.current_user_in_group ('Group1')
       THEN
          RETURN 'Public';
       ELSIF apex_util.current_user_in_group ('Group1')
       THEN
          RETURN 'Internal Only';
       END IF;
    END;Your query:
    SELECT *
      FROM customer
    WHERE visibility = :p1_visibilityshould now work as expected. There are many ways to do that in APEX. This is just one of them and easy to understand.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Conditional Split - Expression Evaluates to Null

    Hi everyone!
    I'm using a conditional split to discriminate modified records. My expression looks like this:
    col1_source != col1_dest || col2_source != col2_des.....and so on. I use OLE DB Command afterward to update modified records.
    It all works fine if no columns evaluate to null. If any (source or dest.) evaluates to null, component fails.
    Any tips how to solve a problem?
    It has to work like this:
    If colX_source is null and colX_dest is not null --> Update
    If colX_source is not null and colX_dest is null --> Update
    If both colX_source and colX_dest are null --> No update
    p.s. i apologize if a similar thread exists, I haven't found something of use to me.

    Thank you both for a quick response.
    I understood the derived column idea but not the isnull idea. 
    If I want to cover all the cases in which I want the update to execute, my expression (if I haven’t missunderstood sth) should look like this: 
    isNull(col1_source) && !IsNull(col1_dest) || !isNull(col1_source) && IsNull(col1_dest) || col1_source != col1_dest
    Isn’t it true that again, the last part of the expression col1_source != col1_dest evaluates to null if one of the columns is null? And that the only solution to the problem is a derived column which transforms null values in “”?
    I’m new to SSIS and slowly learning that programming logic is not always the SSIS logic.
     

  • Conditional SQL?

    Is there a way to write a piece of pure SQL (no PL/SQL allowed!) which will conditionally execute a query or not.
    Something like
    select case when count(*) = 1 then (select * from dba_objects) else null end from my_table;...that is, count the records in MY_TABLE, and if there is one record in there, then select from dba_objects. If there are 0 or 2 or more records, then don't do anything.
    Obviously this is easy to do in PL/SQL... but I would like to know if it is at all possible in SQL alone (let's assume version 10 upwards)
    If there isn't, then that's fine as an answer, too!

    Perhaps doing it along these lines will do what you want (I've done the conditional bit slightly different for demonstration purposes)...
    SQL> with t as (select case when count(*) = &cnt_chk then
      2                      xmltype(dbms_xmlgen.getxml('select empno
      3                                                        ,ename
      4                                                        ,job
      5                                                        ,mgr
      6                                                        ,to_char(hiredate,''YYYY-MM-DD'') as hiredate
      7                                                        ,sal
      8                                                        ,comm
      9                                                        ,deptno
    10                                                  from emp'
    11                                                 )
    12                             )
    13                    else
    14                      xmltype('<ROWSET/>')
    15                    end as xml
    16             from dual
    17            )
    18  select x.*
    19  from   t
    20        ,xmltable('/ROWSET/ROW'
    21                  passing t.xml
    22                  columns empno    number       path '/ROW/EMPNO'
    23                         ,ename    varchar2(10) path '/ROW/ENAME'
    24                         ,job      varchar2(9)  path '/ROW/JOB'
    25                         ,mgr      number       path '/ROW/MGR'
    26                         ,hiredate date         path '/ROW/HIREDATE'
    27                         ,sal      number       path '/ROW/SAL'
    28                         ,comm     number       path '/ROW/COMM'
    29                         ,deptno   number       path '/ROW/DEPTNO'
    30                 ) x
    31  /
    Enter value for cnt_chk: 1
    old   1: with t as (select case when count(*) = &cnt_chk then
    new   1: with t as (select case when count(*) = 1 then
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10
    14 rows selected.
    SQL> /
    Enter value for cnt_chk: 0
    old   1: with t as (select case when count(*) = &cnt_chk then
    new   1: with t as (select case when count(*) = 0 then
    no rows selectedAs far as I can tell, the query to get the data (in my example from the emp table) is only executed by the XMLGen.GetXML if the condition matches, the only thing being that you're left with XML data which you then need to extract back out to flat data.

  • Conditional SQL ( Want to avoid having to write a PL/SQL block )

    I have a SQL statement and I was hoping to not have to write an IF-THEN-ELSE condition. Here is the SQL in hand which I need to expand.
    I need to list the personal information including address of all the employees. However, in the event that I encounter any address ( Home or Office ) where my State is *"NY"*, I should not list the "NY" Address but instead list the address where my address_location = 'O' and address_state_code = *"CA"*.
    Here is my code below. Now, the DB procedure call could retrieve the latest address id as a "NY" location and hence my question.
    SELECT '"'||emp.employee_name,
                  ||'","'||TO_CHAR(emp.birth_date,'YYYY/MM/DD')
                  ||'","'||emp.gender
                  ||'","'||RTRIM(ead.address_line1)
                  ||'","'||RTRIM(ead.address_line2)
                  ||'","'||RTRIM(ead.address_line3)
                  ||'","'||RTRIM(ead.address_location) -- 'O': Office; 'H': Home
                  ||'","'||RTRIM(ead.adh_city)
                  ||'","'||ead.address_zip_code
                  ||'","'||ead.address_state_code
    FROM    employee             emp,
                employee_address ead
    WHERE  emp.emp_num = ead.emp_num
    -- The proccedure db_get_address_id returns me the most recent Address with Max Effective Date
    AND      ead.address_id = db_get_address_id( emp.emp_num )
    ORDER BY v.effective_date DESC, emp.employee_name ASC;
    {code}
    Thanks in advance !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    SELECT  emp_address
      FROM  (
             SELECT  '"'||emp.employee_name,
                            ||'","'||TO_CHAR(emp.birth_date,'YYYY/MM/DD')
                            ||'","'||emp.gender
                            ||'","'||RTRIM(ead.address_line1)
                            ||'","'||RTRIM(ead.address_line2)
                            ||'","'||RTRIM(ead.address_line3)
                            ||'","'||RTRIM(ead.address_location) -- 'O': Office; 'H': Home
                            ||'","'||RTRIM(ead.adh_city)
                            ||'","'||ead.address_zip_code
                            ||'","'||ead.address_state_code emp_address,
                            ROW_NUMBER() OVER(ORDER BY v.effective_date DESC, emp.employee_name ASC) RN,
                            CASE
                              WHEN ead.address_state_code = 'NY' THEN CASE MAX(
                                                                               CASE ead.address_state_code
                                                                                 WHEN 'CA' THEN 1
                                                                               END
                                                                              ) OVER(PARTITION BY emp.emp_num)
                                                                        WHEN 1 THEN 0
                                                                        ELSE 1
                                                                      END
                              ELSE 1
                            END TAKE_IT -- 0 means it is NY address for employee who also has CA address, 1 otherwise.
               FROM  employee emp,
                     employee_address ead
               WHERE emp.emp_num = ead.emp_num
                 -- The proccedure db_get_address_id returns me the most recent Address with Max Effective Date
                 AND ead.address_id = db_get_address_id(emp.emp_num)
      WHERE TAKE_IT = 1
      ORDER BY RN
    {code}
    SY.
    Edited by: Solomon Yakobson on Aug 13, 2009 1:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help with conditional build expressions

    I'm using RoboHelp HTML and creating WebHelp Pro layouts. I
    want to create five (or more) different versions of the Help tool
    for our various groups of users.
    Here's what I'd like to do: Create a conditional build tag
    for each of the versions (i.e. each of our groups of users). I
    could name them as follows:
    group1
    group2
    group3
    group4
    group5
    Then, I would associate each topic with one or more of the
    build tags. For example, topic1 may be for group1 and group2;
    topic2 may be for group1 and group4. Etc.
    The problem is thus: When I want to create the version for,
    say, group1, my expression ends up excluding the other groups. In
    the end, this omits any topics associated with group1 that are also
    associated with the other build tags (i.e. the other groups).
    Is there an expression I can use to prevent these topics from
    being omitted? Perhaps the use of parentheses?
    The only solution I've used is tedious: I create many build
    tags--one for each variation. For example, I'd have a
    group1group2group3 build tag, a group1group3 build tag, a
    group1group4 build tag, etc. Then, I just associate one build tag
    with each topic. When I'm creating a version for group1, for
    example, I'd just include all topics with a build tag that includes
    group1 (e.g. group1, group1group3, group1group2group3, et. al.). I
    omit the others (e.g. group2group3, group2group4,
    group2group3group4group5...et. al.).
    As you can imagine, this solution is problematic. First, I
    have to create and keep track of many many build tags. Then, if I
    want to create another version of Help, I need to change all the
    build tags to include this new group.
    I'm sure there must be a better build tag expression for what
    I'm trying to accomplish. Please help! Thanks!

    There is indeed an expression! Unfortunately, the option is
    normally hidden, so it can be tricky to find. Here's what you do:
    1. Define the build tags.
    2. Apply them to your topics. OVERLAPPING IS ENCOURAGED! That
    is to say, you can assign tag1, tag2, and tag3 to a single topic.
    3. Right-click the desired layout and select Properties.
    4. Click the Define button to the right of the Conditional
    Build Tag drop-down menu. The Define Conditional Build Tag
    Expression dialog will appear.
    5. Click the Advanced button. The Advanced area will appear
    at the bottom of the dialog.
    6. Select a tag from the Available Conditional Build Tags
    drop-down menu.
    7. Click the Add Tag button. The selected tag will appear in
    the Conditional Build Tag Expression display window.
    8. Click the AND button.
    9. Select another tag from the drop-down menu.
    10. Click the Add Tag button.
    11. Repeat steps 8-10 for each tag you wish to add to the
    expression.
    12. Click the OK button to close the dialog.
    13. Click the Save button to save your layout with the new
    build expression.
    That's it! The trick is to use the ADVANCED button in the
    Define Conditional Build Tag Expression dialog. Doing so allows you
    to build inclusional expressions rather than exclusional
    expressions, so you can avoid the hassle you described in your
    post. Using this method, I defined two build tags (A and B) and
    applied them to three topics as follows:
    * Topic 1: Tag A
    * Topic 2: Tag B
    * Topic 3: Tags A and B
    I then defined an expression that simply included tag A. When
    I compiled my help, topics 1 and 3 appeared in the output, but
    topic 2 did not.

  • Bug report - Branch condition (SQL exists query)

    APEX 2.2.1
    See http://i13.tinypic.com/2ni8gol.jpg
    The branch condition is a "Exists SQL query" with select from dual where 1=2 i.e. it is a invalid SQL query, as the screenshot shows.
    But the APEX accept processing engine just ignores the syntax error and proceeds to evaluate the next branch.
    Thanks

    thanks, Vikas. It's interesting that if you don't have any later branches on the page that fire, you will see the condition error (along with the "no page to branch to" error).
    Scott

  • Problem with Branch Conditions (Request = Expression 1)

    Application Express 3.1.0.00.32
    I've looked around on the internet and couldn't find anything to differ from what I thought I was doing correctly.
    The issue I am having is that I have 4 push buttons (2 on top and 2 on bottom) that when pressed, should redirect to the same page. For the branch condition, I set the type as Request = Expression 1 and placed the values that the buttons submit as in the expression 1 field.
    For the push button pressed, I do not have a button selected.
    In testing whenever I press a button, the following error is given:
    ERR-1777: Page 4 provided no page to branch to. Please report this error to your application administrator.
    Any ideas?

    Hi Leland,
    Check the names you have used in Expression 1.
    I have just created two buttons on a page called P4_BUTTON1 and P4_BUTTON2.
    My Expression 1 setting shows:
    P4_BUTTON1,P4_BUTTON2and the branch works ok
    Andy
    ps - if you have more than one button that could control the branch, the condition should be "Request is Contained within Expression 1"
    Edited by: ATD on Jan 14, 2009 5:45 PM

  • Conditional EL expression for icon attribute

    Hi Folks,
    I am using Jdev 11.1.1.4.0
    I am using the af:commandImageLink component. It has an attribute "icon" which supports EL expression. I am tying to use a condition like
    icon="#{isFlagTrue ? '/image/image1.jpg' : '/image/image2.jpg'}"
    It doesnt seem to work. If I just give the path /image/image1.jpg for the icon attribute without the condition, the icon is displayed properly.
    Any idea why the above condition is not working?
    Thanks
    Vishal

    Actually I tried that. Even tried
    icon="#{isFlagTrue ? /image/image1.jpg : /image/image2.jpg}"
    But nothing works for me

  • Condition step expression comparison

    Hi all,
    I want use a condition step to check acondition like lv_expression1 = lv_expression2.
    but i am not able to use variable in expression2, it's accepting as constants.
    How to compare two variables in workflow?
    Thanks.

    It should be possible in the condition editor. First double click the first container element. Then set for example '='. Now double click another container element (don't put anything into the constant field). => You have comparison between two container elements.
    Regards,
    Karri
    Edited by: Karri Kemppi on Dec 13, 2011 5:07 AM

  • How do I generate output with a certain conditional build expression?

    Hi,
    I am learning how to use conditional tags in RoboHelp 9.  I see how to create and apply the tags.  How do I apply the conditions in the output?  And can I apply the conditions to the Web output  and printed output?
    I am going to be working on a project with variations to suit each customer, so I am wondering if RH 9 is a good tool to use for this.  (I have access to XMetaL 5 also.)
    Thanks,
    Erin

    You pick them in your Single Source Layout recipe

Maybe you are looking for

  • Error in standard network creation using BAPI

    hi, I need to create standard network using BAPI. I am trying with BAPI_BUS2002_CREATE. As per the documentation, I need to call function BAPI_PS_INITIALIZATION. But, I am not able to get the required output since its giving me error. Does anybody ha

  • Time Machine Migration Question

    I am in the process of moving my Time Machine from a USB attached drive to a NAS.  I am looking to do the initial backup on the NAS and was presented with the option of replacing the USB drive with the NAS or alternating between the two.  My USB driv

  • Cursor disappears in PS CS5 after OS10.8 upgrade

    Hello, I have a problem in Photoshop CS5 (v. 12.0.2) after ugrading my Mac system to Mountain Lion 10.8.1. I use a mouse (not wireless, also tried changing mouse). When I work with a picture using the brush tool and move the cursor to a palette or me

  • Invoice verification print out

    Helo SAP Experts, How to take Invoice verification Prinout in mm? thanks babu

  • I want to report a bug in your itunes software, I want to report a bug in your itunes software

    my itunes library was on a external drive.   it was connected to Itunes on my mac book pro which was recently stolen. I install itunes on to my win  7 x64 laptop, at that point I went into advanced properties of itunes to point the progarm to my old