Using a shortcut in a Condition

I have a SQL Expression used in many conditions on many pages. It uses app level items and static strings.
How can I store it in one place as say a shortcut or app-level substitution string? This way, I need to change it one place only.
Thanks

Yes, I could, but it seems like a waste to create a one-line stored function. It is really just a INSTR() thats all, I thought it would be nice to handle it in HTML DB itself. I thought substitution strings and shortcuts were designed for this sort of stuff (reuse SQL and PL/SQL fragments), right?
Thanks

Similar Messages

  • Error in using a variable in filter condition in an Interface

    Hi All,
    I am using a variable in my interface in a filter condition. I have an EMP table of scott schema and want to pull all the records wiht hiredate date lying between 2 dates, incremental pull.For this I have created 2 variables and using them in the filter condition. I am getting an error inthe interface when I run in a package after declaring and refresing the variables.
    com.sunopsis.sql.SnpsMissingParametersException: Missing parameter
         at com.sunopsis.sql.SnpsQuery.completeHostVariable(SnpsQuery.java)
         at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Regards,
    Krishna

    Hi Krishna,
    What is the datatype of the Variable lastupdate ?
    In my case
    Variable
    Name : LastUpdateDate
    Datatype : Alphanumeric
    Action : Historize
    Query : select to_char(to_date(sysdate,'DD-MON-YY'),'DD-MON-YY') from sys.dual
    Then in filter I used
    EMP.HIREDATE>to_date('#LastUpdateDate','DD-MON-YY')
    Thanks
    Sutirtha

  • Using Select statement in IF condition?

    hi all,
    Can i use select statement in IF COndition in pl sql ?
    eg like- if( select 1 from ASD) then
    end if;

    There is no way to do any kind of select statement inside if conditions.
    Why don't test simple cases like this first?
    An example to show it.
    SQL> begin
      2   if exists (select 1 from dual) then
      3    dbms_output.put_line('ok');
      4   end if;
      5  end;
      6  /
    if exists (select 1 from dual) then
    ERRORE alla riga 2:
    ORA-06550: line 2, column 5:
    PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL
    statement only
    ORA-06550: line 2, column 2:
    PL/SQL: Statement ignored
    SQL> begin
      2   if ( (select count(*) from dual) > 0 ) then
      3    dbms_output.put_line('ok');
      4   end if;
      5  end;
      6  /
    if ( (select count(*) from dual) > 0 ) then
    ERRORE alla riga 2:
    ORA-06550: line 2, column 8:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternativ
    ORA-06550: line 2, column 33:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    . , @ ; for <an identifier>
    <a double-quoted delimited-identifier> group having intersect
    minus order partition start subpartition union where connect
    SQL> begin
      2   if ( 0 in (select count(*) from dual) ) then
      3    dbms_output.put_line('ok');
      4   end if;
      5  end;
      6  /
    if ( 0 in (select count(*) from dual) ) then
    ERRORE alla riga 2:
    ORA-06550: line 2, column 12:
    PLS-00405: subquery not allowed in this context
    ORA-06550: line 2, column 2:
    PL/SQL: Statement ignoredBye Alessandro

  • Issue in using presentation variable as filter condition in the reports

    Hi,
    I have an issue in using presentation variable as filter condition in my reports the details are as follows:
    Details :
    We want to implement the Max and Min variables through Presentation variables only.we do not want to implement it through session variables in this case.
    We have two variables MIN and MAX to be used as Presentation Variables,for a column of the report (which is a quantity),so that the user wants to see the data for this column within a particular range.i.e the Min and the Max.This part has been implemented well . The issue is when the user wants to see the full data.In that case we will not pass any values to these two Presentation Variable or in other words we are not restricting the report data so we are not passing any value to the variables,this is when the report is throwing the error. we want to leave this variables blank in that case.but this is giving error.
    Please suggest how can I overcome this issue.
    Thanks in Advance.
    Regards,
    Praveen

    i think you have to use guided navigation for this. create two reports first is the one you are having currently and second is the one in which remove the presentation variable from the column formula. i.e. the same report with no aggregation applied.
    Now create a dummy report and make it return value only when the presentation variable value is not equal to max or min. guide the report to navigate between the first and second report based on the result of the dummy report.

  • When I use the shortcut to open a new window in safari (command N), I get a 404 error message from Google. How do I change where 'Command N' routes to?

    When I use the shortcut to open a new window in safari (command N) on my Macbook Pro, I get a 404 error message from Google. How do I change where 'Command N' routes to? 

    It's not necessary to change the Command N keystroke..
    From your Safari menu bar click Safari > Preferences then select the Privacy tab.
    Click:   Remove All Website Data
    Then delete the cache.
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.
    If that didn't help, troubleshoot Safari extensions.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.

  • AE CS6 bug: Can't use any shortcut that includes the C in it

    A while ago I started having some issues In Illustrator CS6, where I couldn't copy and paste from one document/application to another, the issue later ported itself to AE and not much after that anything including the C key stopped working. For example I can't copy, pre compose or create a camera using shortcuts.
    After a lot of troubleshooting I was able to isolate a preference pane who was causing the Illustrator issue, I removed it and AI went back to normal, I assumed After Effects would be fixed too but unfortunately that's not the case, I still can't use the C key.
    I ran Onyx thoroughly, trashed AE's prefs, removed some recently acquired scripts, removed some login items and trashed those prefs also (I read a thread that mentioned those items could be causing odd behaviors).
    I carefully compared my setup against my laptop, which also has AE CS6 installed and working perfectly, I have the same scripts, the same preferences and the only login items not installed there are the ones that's are grayed out in my imac, so I can't delete them.
    If someone can help with this I'll be very grateful, I'm wasting a lot of time trying to solve this thing and I'm very used to using said shortcuts to increase my workflow.
    Thanks.

    I quit a few other components, a small utility called Shortcut (isn't that ironic?) and another one called MacAppBlocker,
    I still can't pre compose any layers using command-shift-c
    I was able to create a camera using command-shift-alt-c, after several tries, sometimes it worked, sometimes it didn't.
    I was being able to copy and paste across different programs and layers all sorts of objects, UNTIL  I opened Illustrator and copied a path, then I pasted it into a solid in AE.
    The next time I tried to copy something else, my clipboard got stuck with the path from Illustrator, EVEN inside illustrator.
    Greg, as you can see from this thread:
    http://forums.adobe.com/message/4462265
    This is an aknowledged bug from Illustrator, but as I have discovered in the past few days it's affecting everything systemwise, what are the possibilities that the only shortcuts that are failing are those that contain the combination of command-c? And like I said, it starts missbehaving right after I copy a path in Illustrator, not before.
    Alright, after some further testing, here's what I found:
    I removed (completely deleted) from my computer a small piece of software called WD Quickview, right after I was able to precomp and create cameras in AE.
    I still have the copy/paste issue from Illustrator, right after I copy a path, the clipboard goes haywire system wide.
    The strange thing is that, such program, WD Quickview has been installed on my computer for over a year now and never had any trouble with it, moreover, I'm not entirely sure how am I going to be able to get into the drive that uses that program (WD force-install that thing with their new drives that come with a new unerasable firmware).
    Coincidentally, I haven't plug the drive at all this week, so perhaps the program went crazy when it couldn't find the drive?
    Message was edited by: David Cabestany
    Ooooops. spoke to soon, this morning the issue came back.
    Message was edited by: David Cabestany

  • Which table i can use to find out the condition type in PO item ?

    Hello, erveryone. Which table i can use to find out the condition type in PO item ? Thank you.
    Xinzhou.

    hi
    The Table name used to find the Tax Values are
    KOMV: Pricing Communications-Condition Record
    KONV: Conditions (Transaction Data)
    From the above tables you can refer the fields below.
    KAWRT
    KBETR
    for excise check table J_1IEXCHDR for header
    J_1IEXCDTL for item excise
    Fetch the corresponding records based on the field
    KNTYP
    regards
    kunal

  • Is there any way to an index that can be used to include the "OR condition "?

    Hello I have some questions.
    The test was conducted in the following procedure .
    create table test
    c1 varchar2(10),
    c2 varchar2(10),
    primary key(c1)
    create index test_idx1 on test(c2);
    Command> explain select * from test where c1 = 'AAAAAAAAAA' or c2 = 'AAAAAAAAAA';
    Query Optimizer Plan:
      STEP:                1
      LEVEL:               1
      OPERATION:           RowLkRangeScan
      TBLNAME:             TEST
      IXNAME:              TEST
      INDEXED CONDITION:   <NULL>
      NOT INDEXED:         TEST.C2 = 'AAAAAAAAAA' OR TEST.C1 = 'AAAAAAAAAA'
    Command>
    Command> explain select * from test where c1 = 'AAAAAAAAAA' and c2 = 'AAAAAAAAAA'
    Query Optimizer Plan:
      STEP:                1
      LEVEL:               1
      OPERATION:           RowLkRangeScan
      TBLNAME:             TEST
      IXNAME:              TEST
      INDEXED CONDITION:   TEST.C1 = 'AAAAAAAAAA'
      NOT INDEXED:         TEST.C2 = 'AAAAAAAAAA'
    Command>
    By including the "OR condition " in this test does not use the index.
    Is there any way to an index that can be used to include the "OR condition "?
    Thanks.
    GooGyum.

    A database cannot in general use indexes in this way for an 'or' involving two different columns. However, for this specific example one can easily rewrite the query using 'UNION' to use the relevant indexes while still giving the same (correct) result:
    Command> explain select * from test t1 where t1.c1 = 'AAAAAAAAAA' union select * from test t2 where t2.c2 = 'AAAAAAAAAA';
    Query Optimizer Plan:
      STEP:                1
      LEVEL:               1
      OPERATION:           RowLkRangeScan
      TBLNAME:             TEST
      IXNAME:              TEST
      INDEXED CONDITION:   T1.C1 = 'AAAAAAAAAA'
      NOT INDEXED:         <NULL>
      STEP:                2
      LEVEL:               2
      OPERATION:           RowLkRangeScan
      TBLNAME:             TEST
      IXNAME:              TEST_IDX2
      INDEXED CONDITION:   T2.C2 = 'AAAAAAAAAA'
      NOT INDEXED:         <NULL>
      STEP:                3
      LEVEL:               1
      OPERATION:           OrderBy
      TBLNAME:             <NULL>
      IXNAME:              <NULL>
      INDEXED CONDITION:   <NULL>
      NOT INDEXED:         <NULL>
      STEP:                4
      LEVEL:               2
      OPERATION:           UnionMergeSort
      TBLNAME:             <NULL>
      IXNAME:              <NULL>
      INDEXED CONDITION:   <NULL>
      NOT INDEXED:         <NULL>
    Maybe you can apply a similar trick? If you know there is no possibility of duplicate rows then you can further optimise this (in terms of performance) by using UNION ALL.
    Chris

  • Is there a way to use a shortcut value in the page's header template ?

    Hello everybody,
    we would like to create a page template with centralized information in the database. I tried to use the shortcuts inside the page template, but it doesn't seems it's working, or I'm not using it correctly.
    The only way I was able to use it is by using javascript to instanciate some properties, But I don't like that idea because it means I must edit all the page using that script. I simply want to change the page template and the changes be applied to all the page who are using that template.
    Here is what I want to do :
    <img src="#WORKSPACE#image/logo.png" alt='"MY_SHORTCUT"' />
    IS there a way to have a dynamic substitution variables that I could use in my html object attributes ? (I'm using APEX 3.2)
    Thank you
    Leinad
    Edited by: leinadjan on Oct 2, 2012 8:58 AM

    leinadjan wrote:
    Hello everybody,
    we would like to create a page template with centralized information in the database. I tried to use the shortcuts inside the page template, but it doesn't seems it's working, or I'm not using it correctly.
    Shortcuts are not available for use in page templates. This is something of a pain.
    The only way I was able to use it is by using javascript to instanciate some properties, But I don't like that idea because it means I must edit all the page using that script. I simply want to change the page template and the changes be applied to all the page who are using that template.
    Here is what I want to do :
    <img src="#WORKSPACE#image/logo.png" alt='"MY_SHORTCUT"' />
    IS there a way to have a dynamic substitution variables that I could use in my html object attributes ? (I'm using APEX 3.2)The closest equivalent to shortcuts in this case is probably an application item. Set the value using an application computation or process and reference it in the page template using static substitution syntax:
    <a href="http://myserver.com/htmldb/f?p=100:1:415680519803489:::::" title="&APP_ITEM."> <img src="#WORKSPACE#image/logo.png" alt="&APP_ITEM." /> </a>Not sure that it's necessarily a good idea to use the same value for link <tt>title</tt> and image <tt>alt</tt> text in this case though. What value(s) will be used?

  • How to Capitalize the first letter or an entire word using a shortcut on the keyboard just like in microsoft that uses shift+F3

    please how can one How to Capitalize the first letter or an entire word using a shortcut on the keyboard just like in microsoft that uses shift+F3

    What do you mean there was "no effect?" I'm not aware of any effects.
    It looks like that Service is also in the App Store. From their screen shots, the services are prefaced with WordService:
    You can see an example in the App Store for their app: App Store
    After installing, you should now have those text services in your Services menu. You can then add shortcuts in the Keyboard System Prefs.
    Most Apple apps have a Transformations menu in the Edit menu. You can Make upper, lower, and Initial caps with those. I would stick with Word Services, but you can make Application Shortcuts for the items in the Transformations menu.
    Again, in Keyboard System Prefs, Under Applications, Click the Add button on the right side pane.
    Set it for All Applications
    Enter the menu command exactly as they appear in the Transformation menu (separate entries for each),
    Make Upper Case
    Make Lower Case
    Capitalize
    Give them a shortcut.

  • ORA-00936: Missing Expression when using a claculation as a condition item

    Hi
    I created a calculation below to create a subtotal on each row of a group of selected items.
    SUM(Invoice Amount)OVER(PARTITION BY Supplier Num ORDER BY Payment Currency Code)
    This worked fine - but then I wanted to create a condition based on this calculation and when I used the calculation as a condition item and reran the report I received the 'ORA-00936: Missing Expression' error. So not too sure why it is fine as a calculation but not as part of a condition.
    We use Discoverer version 4.1
    Am I missing something or is this a bug?
    Any help would be very appreciated
    Thanks
    Marcus

    Thanks for your reply, Rod
    We are using the 9.2.0.5 version of the database
    I am not a SQL expert, by any means, but below is the line that refers to the condition in the sql inspector
    WHERE ( ( E_152 )/2 > 50)
    presuambly that means E_152 is the calculation, I think this may be refering to this at the beginning of the report:
    SELECT DISTINCT E316344 as E316344,E316372 as E316372,E316411 as E316411,E316425 as E316425,E316496 as E316496,E316497 as E316497,E316498 as E316498,E316510 as E316510,E316511 as E316511,E316512 as E316512,E316515 as E316515,E316517 as E316517,E316519 as E316519,E316520 as E316520,E_24 as E_24,E_21 as E_21,E_18 as E_18,E_16 as E_16,E_13 as E_13,E_11 as E_11,E316501 as E316501 FROM ( SELECT E_152 as E_152,DISTINCT E316344 as E316344,E316372 as E316372,E316411 as E316411,E316425 as E316425,E316496 as E316496,E316497 as E316497,E316498 as E316498,E316510 as E316510,E316511 as E316511,E316512 as E316512,E316515 as E316515,E316517 as E316517,E316519 as E316519,E316520 as E316520,E_24 as E_24,E_21 as E_21,E_18 as E_18,E_16 as E_16,E_13 as E_13,E_11 as E_11,E316501 as E316501 FROM ( SELECT DISTINCT i316344 as E316344,i316372 as E316372,i316411 as E316411,i316425 as E316425,i316496 as E316496,i316497 as E316497,i316498 as E316498,i316510 as E316510,i316511 as E316511,i316512 as E316512,i316515 as E316515,i316517 as E316517,i316519 as E316519,i316520 as E316520,SUM(i316501) OVER(PARTITION BY i316345 ORDER BY i316520 )/2 as E_24,( i316501-( NVL(i316502,0) ) )*( NVL(i316522,1) ) as E_21,i316501-( NVL(i316502,0) ) as E_18,NVL(i316502,0) as E_16,i316501*( NVL(i316522,1) ) as E_13,NVL(i316522,1) as E_11,i316501 as E316501,SUM(i316501) OVER(PARTITION BY i316345 ORDER BY i316520 ) as E_152
    Apologies if this info is not that helpful
    Would it have anything to do with the fact that the row calculation is based on several rows (i.e. a subtotal) and if a single row is excluded it would change the value of the other rows within that subtotal group. Maybe it causes some sort of circular issue?
    Anyway, thanks again for your help - hopefully we can resolve it
    Marcus

  • How to use allies names in ON condition

    i have the following query.
    SELECT
    DD.DATE_KEY
    , (SELECT MIN(NVI_DATE) AS NVI_MIN_DATE FROM FCT_SPA_NVI_OUTRIGHT A WHERE A.VENDOR_CODE=V.VENDOR_CODE) AS NVI_MIN_DATE
    , VO.BANK_ACCOUNT_NO
    , VO.BANK_NAME
    , VO.BANK_ROUTING_NO
    FROM DIM_VENDOR V
    LEFT JOIN FCT_SPA_NVI_OUTRIGHT VO
    ON V.VENDOR_CODE = VO.VENDOR_CODE
    LEFT JOIN FCT_SPA_NVI_MERCHANDISE VP
    ON VO.NVI_KEY=VP.NVI_KEY
    LEFT JOIN DIM_DATE DD
    ON VO.NVI_DATE=DD.DATE_FLD
    in the above query, how to use NVI_MIN_DATE in the ON condItion like.,
    LEFT JOIN DIM_DATE DD
    ON NVI_MIN_DATE=DD.DATE_FLD
    Thanks in advance.
    bala krishna

    Try using a CTE, so something like this.
    WITH TableA (NVI_MIN_DATE, BANK_ACCOUNT_NO, BANK_NAME, BANK_ROUTING_NO)
    AS
    SELECT
    (SELECT MIN(NVI_DATE) AS NVI_MIN_DATE FROM FCT_SPA_NVI_OUTRIGHT A WHERE A.VENDOR_CODE=V.VENDOR_CODE) AS NVI_MIN_DATE,
    VO.BANK_ACCOUNT_NO,
    VO.BANK_NAME,
    VO.BANK_ROUTING_NO
    FROM DIM_VENDOR V
    LEFT JOIN FCT_SPA_NVI_OUTRIGHT VO
    ON V.VENDOR_CODE = VO.VENDOR_CODE
    LEFT JOIN FCT_SPA_NVI_MERCHANDISE VP
    ON VO.NVI_KEY=VP.NVI_KEY
    SELECT
    DD.DATE_KEY,
    TableA.*
    FROM TableA
    LEFT JOIN DIM_DATE DD ON
    TableA.NVI_DATE=DD.DATE_FLD
    John Sansom | SQL Server MCM
    Blog |
    Twitter | LinkedIn |
    SQL Consulting

  • Why I can't used any shortcut  in word?

    First day I used word to do my file, it can used the shortcut, such as "command+C for copy and command+V for paste".
    Now I can't used any shortcut in word, even though I opened another word file also can't used any shortcut.
    But I still can used the shortcut for web side such as "command+C" but if i need to paste in work can't used "command+V"
    Also that file send to another computer the shortcut can work again. Why......

    Hello Vicki,
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive & clear caches.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.

  • Use Japaness words as search condition, but can't retrive data

    Hi,
      I encountered this problem. In report, I use client name as a condition. User can choose a client to
    retrieve data.
       but when user choose a Japanese client name(or other non-English language), can't get data.
       I use the sql genereated by bo to exetute in SQL SERVER2005:
    Select * from m_client where client_local_name = u2019たなかさu2019,no data found,
    but change to  Select * from m_client where client_local_name = Nu2019なかさu2019,can retrieve data.
    Here I use N before the Japanese word
    how to set my DB or set my BO server to solve this issue?
    Best Regards,
    Tony Renjie

    Try this:
    1) Open Designer
    2) File --> Parameters
    3) go to the Parameter tab
    4) add a new value: "UNICODE_STRING"  = "Yes"
    Good luck!

  • Use of Shortcuts in Lightroom

    I am a wedding photographer and I find LR very slow and frustrating because it all appears to be mouse driven, rather than using shortcuts. My main bug is not being able to use a shortcut key to access the next photo in Develop after you have manually adjusted a photo. If you use the Ctrl L key and you happened to have adjusted the blacks and the mouse is still over the blacks...it does nothing at all.
    Also I am having problems with the memory. After loading up 700 jpegs....adjusting them, and getting up to 500 I keep getting AN UNEXPECTED ERROR HAS OCCURED and LR will not load up any more photos in Develop. I think it is like a scratchpad issue. Has anyone else experienced this and how do you get a round it.

    Not he empty FAQ here but at
    LR Extras FAQ, under 'Info to start with.
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core, Pentax *ist D
    http://donricklin.blogspot.com/

Maybe you are looking for