Use of basic SQL functions in conditional display of an item

I'm trying to use the following to conditionally display an item.
Condition Type is set to: "Value of Item in Expression 1 = Expression 2"
Expression 1: "sign ( instr ( :column_name, '1*' ) )"
Expression 2: "1"
The :column_name column contains an asterisk delimited list of numbers. I wish to hide or show an item based on whether a specific number is in the list. When I run the page, the item never shows up. For testing purposes, I am using HTP.P to display not only the entire value of :column_name, but also the resulting value from the "sign(instr(... ))" code. The results of the HTP.P debugging show that the expression does indeed return a value of 1, but the item is still not displaying.
Any thoughts? I'm relatively new to HTML DB, so there may be some obvious thing I am missing.

Try setting the Condition Type to "PL/SQL Expression" and use:
sign ( instr ( :column_name, '1*' ) ) = 1
The express must evaluate to TRUE for the item to display. See the "Conditions Available in Oracle HTML DB" section in the Oracle HTML DB User's Guide.

Similar Messages

  • Every time I try to upload a video to youtube (or pictures to blog services like tumblr) using Firefox, I cannot upload them unless I use the "basic uploader" function. Why and what can be done?

    Every time I try to upload a video to youtube or a pictures to a blog service, such as tumblr, I am unable to do so with the default uploading options (usually something that allows multiple uploads, etc). Instead, I can upload these media using their "basic upload" functions. Why and what can be done?
    == URL of affected sites ==
    http://www.youtube.com; http://www.tumblr.com

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • How to find listing of modules which has used xyz PL/SQL function?

    Hi,
    How I can find the list of forms/reports which has used xyz pl/sql function?
    I want to delete a pl/sql function but before that I would like to
    make sure this function is not being used by any forms/report.
    Thanks for your help!!
    D

    There are many tools available for finding out the particular string across many forms in one shot.
    One such utility is forms apimaster.
    You can download it's 30 days free trial from the internet.

  • Application Level Function for Conditional Display

    I need to hide a field on Print Preview if it is null. I currently have the following PL/SQL Expression Condition:
    :P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
    It works great; now I need to do this for a lot more fields within my application. Is there a way to call a PL/SQL process defined in HTML DB, passing it the current item value, or some other way to save myself some typing?
    I've tried various combinations of shortcuts, substitution strings, application processes, etc. and can't seem to get the right combination.
    I'm hoping you have a cool solution, or some other ideas I can try out.
    Thanks!
    Chaunaci

    Hi Raj,
    All of this came up because we have several data items displayed above each report page, which allow the user to enter filter criteria. When the page is displayed in Print Friendly mode, the Select Lists display as blanks when null, but Text Boxes display as [] when null.
    Our QAs have asked us to make all of the filter fields consistent in appearance in Print Friendly mode. The work-around solution is to hide the filter fields that are null when in Print Friendly mode. Therefore, we came up with the following PL/SQL Expression to use in the Conditional Display:
    :P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
    Because I will need to add the above conditional statement to many items, I was hoping to create and call an HTML DB application-level process and pass the current item value in, so my conditional display logic would look something like...
    HIDE_NULL_ON_PRINT(:P305_DEPT).
    When I was doing some additional testing last night, I realized my boolean logic needed to be tweaked, and it would be nice to tweak it in just one place, rather than on every field's conditional display.
    I currently have it working by putting the IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES' into an application substitution string, so my conditional logic shows as:
    :P305_DEPT &HIDE_NULL_FOR_PRINT.
    In trying to determine if this was the best solution, I need answers to the following issues:
    1. Is there a way to generically reference the current item in the conditional display logic? I currently type in the specific item name (ex: :P305_DEPT), but it would be nice if instead I could just say &CURRENT_ITEM_NAME. (or something similar).
    2. Can I create an application-level process, pass a parameter into it (the current item), and have it return a value that can be evaluated by my conditional logic display?
    Thanks so much for your quick responses to this and all my previous posts. It is wonderful to be able to post a problem at the end of the day, and come in to a solution in the morning!
    Chaunaci

  • Problem to create a link with parameters using a PL/SQL function body

    Hi everybody,
    I need some help to create a link on a SELECT statement.
    I have a region report with type "PL/SQL function body return SQL query".
    I would like to use a link using HTML tag <a href>.
    I know how to do the link, but I don't know to pass a parameters in <a href> statement.
    Always I tried it doesn't work well.
    My PL/SQL anonimous block is, (just with link) :
    DECLARE
    q vARCHAR2(4000);
    BEGIN
    q:='select     "INDICADOR"."NRINDICADOR" as "NRINDICADOR",';
    q:=q||'     "INDICADOR"."DSINDICADOR" as "DSINDICADOR",';
    q:=q||'''<span style="font-weight:bold;">';
    q:=q||'''||TO_CHAR("TOTAL_INDICADOR"."VL_INDICADOR", ''999G999G999G990D00'')||''</span>''';
    q:=q||' as "VL_INDICADOR",';
    q:=q||'     "TOTAL_INDICADOR"."VL_META" as "VL_META" ';
    q:=q||' from     "TOTAL_INDICADOR" "TOTAL_INDICADOR",';
    q:=q||'     "INDICADOR" "INDICADOR" ';
    q:=q||' where "INDICADOR"."NRINDICADOR"="TOTAL_INDICADOR"."NR_INDICADOR"';
    RETURN q;
    END;
    Thanks for any help,
    Alessandra

    Your code is in a default value for an item, right?
    You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
    How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
    Message was edited by:
    Bill Carlisle

  • EBS ISG using custom PL/SQL functions that return XMLType

    Hi,
    We have a custom PL/SQL package that we use for interfacing systems and some of the functions in this package ruturn an XMLType. We want to deploy the package functions as web services through the ISG, but it is not working as expected. When deployed through the ISG, the functions with XMLType return type produce a null response from the ISG (they work fine when called in SQL or PL/SQL; functions with non-XMLTypes work fine).
    If we change the return type to CLOB (and use getClobVal() on the XMLType) then we get a response from the ISG, but it changes all the angle-brackets in the CLOB (which is still arbitrary XML text) to &lt; &gt; ...
    What is the proper way to get the complex XMLType output through the ISG? Anyone have any more experience?
    Thanks,
    --Walt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Alex,
    For the predicate groups that are indexed/stored, the exact operator types (as in equality, inequality, like etc) that are indexed are specified while assigning the default index parameters. In the following example, exf$indexoper is used to specify the list of indexed operators.
    BEGIN
      DBMS_EXPFIL.DEFAULT_INDEX_PARAMETERS('Car4Sale',
        exf$attribute_list (
           exf$attribute (attr_name => 'HorsePower(Model, Year)',
                          attr_oper => exf$indexoper('=','<','>','>=','<='),
                          attr_indexed => 'FALSE')    --- stored predicate group
    END;
    /You can find more information about exf$indexoper at
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/t_expfilobj.htm#ARPLS153
    Could you confirm that you chose to index 'is null' and 'is not null' while assigning the default index parameters ? This information is available in OPERATOR_LIST column of the USER_EXPFIL_DEF_INDEX_PARAMS view.
    Hope this helps,
    -Aravind.

  • Retrive records using ODATA with SQL functions

    Hi,
    I want to use SQL functions (for instance replace function) while retrieving records using ODATA endpoint using javascript. Like this:
    parent.SDK.REST.retrieveMultipleRecords(
    "$select=AccountId,Name,Telephone1&$filter=" + "replace(Telephone1,'-','') eq '12345678'",
    function (accountresults) {
    errorHandler,
    function () {
    But this is ending up with 404 bad request. Is there any way to achieve the same using any other technique?
    blog: <a href="http://technologynotesforyou.wordpress.com">http://technologynotesforyou.wordpress.com</a> | skype: ali.net.pk

    ODATA only supports simple comparison operators, and startswith, endswith and substringof. There are 2 approaches you could use without modifying the data:
    Have a less selective filter in ODATA, then filter the rest of the data in javascript. In this example, you could use ODATA to find all records where the telephone1 field has each of '1', '2', '3' etc, then use javascript to do the replace comparison. It
    depends how many records you have as to whether this is practical
    Write a plugin on RetrieveMultiple that applies the functions you want. This is not necessarily simple, and you'd need to determine how you identify in the query that you want to use a function like replace
    Another option could be to use a plugin when data is saved to strip out the characters you don't want, and store the results in a different field that you could then query on
    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

  • Using an Oracle SQL Function from JPA/TopLink

    How do I get the return value from a simple (one string input parameter, returns a string) Oracle SQL Function?
    Thanks!

    If you mean calling a stored function in Oracle, you might try something like:
        ValueReadQuery vrq = new ValueReadQuery();
        SQLCall call = new SQLCall("begin ###res := pkg.funcInp(#inp); end;");
        vrq.setCall(call);
        Query q = em.createNativeQuery("");   // we need a Query; any query would do; we replace its contents below
        ((EJBQuery)q).setDatabaseQuery(vrq);
        q.setParameter("inp", "paramValue");
        String result = (String)q.getSingleResult();
        // #=input; ###=output; ####=input/output;
        // if you want to explicitly specify the type of an output parameter, use #### instead of ###,
        // because pure "output" parameters are always treated as java.lang.StringThis will only work in TopLink Essentials, though. I don't know how to do it in Hibernate. I have dealt mainly with TopLink, and just a little with Hibernate.
    In my opinion, it's a HUGE omission not to have support for stored procedures in JPA. Virtually every project I have worked on (in two large companies) has consisted of a large portion of code in stored procedures (sometimes as much as 50% of the overall code). It's a pain to have to go through all that trouble to call the stored procedures.
    Also, pay special attention to TopLink's shared L2 cache. If a stored procedure changes something in the database, TopLink won't know about it and chances are that you will end up with stale objects in the cache which you will either have to refresh, or you'd have to invalidate TopLink's cache for these objects.
    Best regards,
    Bisser

  • Conditional Display on multiple items?

    Is it possible to use multiple items in the conditional display region of a report? For example I'm trying to use the
    "Value of Item in Expression 1= Expression 2" and when I populate 1 item with the value in expression 2 it works just great but if I try to place 2 items that would both equal expression 2 it does not work.
    I've tried
    Expression 1:
    P14_ITEM1, P14_ITEM2
    Expression 2:
    10
    Is this possible? And if so is there different syntax I should using in Expression 1 to identify my items?
    Thanks,
    Zala

    I have done something similar but I used the exists statements and write a SQL "SELECT 1 FROM dual WHERE :x1 = :x2".
    Cheers Mike
    Edited by: MikesHotRod on Aug 25, 2008 1:31 PM

  • Using a PL/SQL function in SQL

    Hello
    I wrote a function in pl/sql that create a table and return the name of the table as varchar2.
    The function is AUTONOMOUS TRANSACTION.
    I want to write a SQL that in the �FROM� section will call the function.
    The SQL will take the name of the table (from the function) and recognize it as a table.
    That way I can preform a join between the new table and other tables.
    Do you know on a way to preform that?
    I wrote the following SQL:
    (assume the name of the function is � �New_table()� return varchar2 )
    Select *
    From (select �New_Table()� from dual) ;
    This return the name of the table. But I want a SQL that will bring the data from the table
    Apreciate your help
    Hilit

    You say "I wrote a function in pl/sql that create a table and return the name of the table as varchar2.", now you want to select data from the newly created table in the same sql statement?
    Although you could cobble something together in PL/SQL using EXECUTE IMMEDIATE, or in a sql script using several statements that would work, where will the data come from?
    I'm guessing that you are populating the table in the function and are hoping to use it as something similar to a temp table in Sybase/SqlServer. If so, there are almost certainly several better ways to do this in Oracle.
    Why don't you tell us what you are trying to accomplish by building a table in the FROM clause of a sql statement, and maybe someone can give a better solution.
    TTFN
    John

  • Using FIFO as sql code for assigning indicator to data items

    Hi All,
    We are looking for a solution based on FIFO algorithm. We have a table having following data:
    We need to perform FIFO on this table, and assign "object" as data items to other rows based on following conditions:
    1. first we have to group the rows based on "object" column
    2. then we have to traverse each group from the row having  minimum start time of the object group e.g: row id 1 for object group for "19O"
    2.1 Assign a "EqpREf" as "object" + <an integer value> , where integer value changes when the start and end chain finishes. Start -end chain is explained in step 2.2
    2.2 then we have to pick the "nextstarttime" of the picked row and compare it against the closest "starttime" of the rows having "start" as same as "end" of the same row we are
    picking for "nextstarttime" e.g: row id 2 of object 19O is having "nextstarttime" 0310 closest to "starttime" 0355 of row id 2 of object 19O , and rowid 2 is having "start" AAL which is similar to "end" of
    rowid 1 
    2.3 We have to perform this chain till we find end of same and allocate each row in a chain same "Eqpref"
    hence the output we need to generate will come as:
    Kindly help on same.
    Thanks in advance
    -Regards
    Kumud

    Hi,
    Please find the following code block for what is input data and what should be output.
    --The input data
    create table temp_table
    row_id int,
    engine_no varchar(20),
    schedule_no varchar(20),
    start_station varchar(20),
    end_station varchar(20),
    startdate datetime,
    enddate datetime,
    starttime datetime,
    endtime datetime,
    record_id int,
    engine_id int,
    Mgt int,
    nextstarttime datetime,
    Schedule_ref varchar(20),
    Engine_Ref varchar(20)
    GO
    insert into temp_table values(1,'19O','101','SGC','IXP','2015/01/01','2015/01/01','00:00:00','01:00:00',1,10,60,'02:00:00',null,null)
    insert into temp_table values(2,'19O','102','SGC','IXP','2015/01/01','2015/01/01','00:30:00','01:30:00',2,10,60,'02:30:00',null,null)
    insert into temp_table values(3,'19O','103','SGC','IXP','2015/01/01','2015/01/01','02:30:00','03:30:00',3,10,60,'04:30:00',null,null)
    insert into temp_table values(4,'19O','104','IXP','DFW','2015/01/01','2015/01/01','03:30:00','04:00:00',4,10,60,'05:00:00',null,null)
    insert into temp_table values(5,'19O','105','IXP','DFW','2015/01/01','2015/01/01','04:30:00','05:30:00',5,10,60,'06:30:00',null,null)
    insert into temp_table values(6,'19O','106','DFW','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',6,10,60,'07:00:00',null,null)
    insert into temp_table values(7,'19O','107','DFW','ABC','2015/01/01','2015/01/01','06:00:00','07:00:00',7,10,60,'08:00:00',null,null)
    insert into temp_table values(8,'19O','108','DFW','ABC','2015/01/01','2015/01/01','07:00:00','08:00:00',8,10,60,'09:00:00',null,null)
    insert into temp_table values(9,'19O','109','ABC','DEF','2015/01/01','2015/01/01','10:00:00','11:30:00',9,10,60,'12:30:00',null,null)
    insert into temp_table values(10,'19O','110','XYZ','BDW','2015/01/01','2015/01/01','13:00:00','15:00:00',10,10,60,'16:00:00',null,null)
    insert into temp_table values(1,'319','111','PQR','STU','2015/01/01','2015/01/01','00:00:00','01:00:00',11,11,60,'02:00:00',null,null)
    insert into temp_table values(2,'319','211','PQR','STU','2015/01/01','2015/01/01','04:30:00','15:30:00',12,11,60,'16:30:00',null,null)
    insert into temp_table values(3,'319','112','STU','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',13,11,60,'07:00:00',null,null)
    insert into temp_table values(4,'319','212','STU','DEF','2015/01/01','2015/01/01','06:00:00','07:00:00',14,11,60,'08:00:00',null,null)
    insert into temp_table values(5,'319','213','STU','PQR','2015/01/01','2015/01/01','07:00:00','08:00:00',15,11,60,'09:00:00',null,null)
    insert into temp_table values(6,'319','118','STU','XYZ','2015/01/01','2015/01/01','10:00:00','11:30:00',16,11,60,'12:30:00',null,null)
    insert into temp_table values(7,'319','119','DEF','JKL','2015/01/01','2015/01/01','13:00:00','15:00:00',17,11,60,'16:00:00',null,null)
    insert into temp_table values(8,'319','215','ABC','MNO','2015/01/01','2015/01/01','17:00:00','20:00:00',18,11,60,'21:00:00',null,null)
    insert into temp_table values(1,'19O','101','SGC','IXP','2015/01/01','2015/01/01','00:00:00','01:00:00',1,10,60,'02:00:00',null,null)
    insert into temp_table values(2,'19O','102','SGC','IXP','2015/01/01','2015/01/01','00:30:00','01:30:00',2,10,60,'02:30:00',null,null)
    insert into temp_table values(3,'19O','103','SGC','IXP','2015/01/01','2015/01/01','02:30:00','03:30:00',3,10,60,'04:30:00',null,null)
    insert into temp_table values(4,'19O','104','IXP','DFW','2015/01/01','2015/01/01','03:30:00','04:00:00',4,10,60,'05:00:00',null,null)
    insert into temp_table values(5,'19O','105','IXP','DFW','2015/01/01','2015/01/01','04:30:00','05:30:00',5,10,60,'06:30:00',null,null)
    insert into temp_table values(6,'19O','106','DFW','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',6,10,60,'07:00:00',null,null)
    insert into temp_table values(8,'19O','108','DFW','ABC','2015/01/01','2015/01/01','07:00:00','08:00:00',8,10,60,'09:00:00',null,null)
    insert into temp_table values(9,'19O','109','ABC','DEF','2015/01/01','2015/01/01','10:00:00','11:30:00',9,10,60,'12:30:00',null,null)
    insert into temp_table values(1,'319','111','PQR','STU','2015/01/01','2015/01/01','00:00:00','01:00:00',11,11,60,'02:00:00',null,null)
    insert into temp_table values(2,'319','211','PQR','STU','2015/01/01','2015/01/01','04:30:00','15:30:00',12,11,60,'16:30:00',null,null)
    insert into temp_table values(3,'319','112','STU','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',13,11,60,'07:00:00',null,null)
    insert into temp_table values(4,'319','212','STU','DEF','2015/01/01','2015/01/01','06:00:00','07:00:00',14,11,60,'08:00:00',null,null)
    insert into temp_table values(5,'319','213','STU','PQR','2015/01/01','2015/01/01','07:00:00','08:00:00',15,11,60,'09:00:00',null,null)
    insert into temp_table values(6,'319','118','STU','XYZ','2015/01/01','2015/01/01','10:00:00','11:30:00',16,11,60,'12:30:00',null,null)
    insert into temp_table values(7,'319','119','DEF','JKL','2015/01/01','2015/01/01','13:00:00','15:00:00',17,11,60,'16:00:00',null,null)
    insert into temp_table values(8,'319','215','ABC','MNO','2015/01/01','2015/01/01','17:00:00','20:00:00',18,11,60,'21:00:00',null,null)
    --output should come as the data in temp_table_final
    create table temp_table_final
    row_id int,
    engine_no varchar(20),
    schedule_no varchar(20),
    start_station varchar(20),
    end_station varchar(20),
    startdate datetime,
    enddate datetime,
    starttime datetime,
    endtime datetime,
    record_id int,
    engine_id int,
    Mgt int,
    nextstarttime datetime,
    Schedule_ref varchar(20),
    Engine_Ref varchar(20)
    GO
    insert into temp_table_final values(1,'19O','101','SGC','IXP','2015/01/01','2015/01/01','00:00:00','01:00:00',1,10,60,'02:00:00','101','19O-1')
    insert into temp_table_final values(2,'19O','102','SGC','IXP','2015/01/01','2015/01/01','00:30:00','01:30:00',2,10,60,'02:30:00','102','19O-2')
    insert into temp_table_final values(3,'19O','103','SGC','IXP','2015/01/01','2015/01/01','02:30:00','03:30:00',3,10,60,'04:30:00','103','19O-3')
    insert into temp_table_final values(4,'19O','104','IXP','DFW','2015/01/01','2015/01/01','03:30:00','04:00:00',4,10,60,'05:00:00','101','19O-1')
    insert into temp_table_final values(5,'19O','105','IXP','DFW','2015/01/01','2015/01/01','04:30:00','05:30:00',5,10,60,'06:30:00','102','19O-2')
    insert into temp_table_final values(6,'19O','106','DFW','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',6,10,60,'07:00:00','104','19O-1')
    insert into temp_table_final values(7,'19O','107','DFW','ABC','2015/01/01','2015/01/01','06:00:00','07:00:00',7,10,60,'08:00:00','107','19O-4')
    insert into temp_table_final values(8,'19O','108','DFW','ABC','2015/01/01','2015/01/01','07:00:00','08:00:00',8,10,60,'09:00:00','105','19O-2')
    insert into temp_table_final values(9,'19O','109','ABC','DEF','2015/01/01','2015/01/01','10:00:00','11:30:00',9,10,60,'12:30:00','106','19O-1')
    insert into temp_table_final values(10,'19O','110','XYZ','BDW','2015/01/01','2015/01/01','13:00:00','15:00:00',10,10,60,'16:00:00','110','19O-5')
    insert into temp_table_final values(1,'319','111','PQR','STU','2015/01/01','2015/01/01','00:00:00','01:00:00',11,11,60,'02:00:00','111','319-1')
    insert into temp_table_final values(2,'319','211','PQR','STU','2015/01/01','2015/01/01','04:30:00','15:30:00',12,11,60,'16:30:00','211','319-2')
    insert into temp_table_final values(3,'319','112','STU','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',13,11,60,'07:00:00','111','319-1')
    insert into temp_table_final values(4,'319','212','STU','DEF','2015/01/01','2015/01/01','06:00:00','07:00:00',14,11,60,'08:00:00','212','319-3')
    insert into temp_table_final values(5,'319','213','STU','PQR','2015/01/01','2015/01/01','07:00:00','08:00:00',15,11,60,'09:00:00','213','319-4')
    insert into temp_table_final values(6,'319','118','STU','XYZ','2015/01/01','2015/01/01','10:00:00','11:30:00',16,11,60,'12:30:00','118','319-5')
    insert into temp_table_final values(7,'319','119','DEF','JKL','2015/01/01','2015/01/01','13:00:00','15:00:00',17,11,60,'16:00:00','212','319-3')
    insert into temp_table_final values(8,'319','215','ABC','MNO','2015/01/01','2015/01/01','17:00:00','20:00:00',18,11,60,'21:00:00','112','319-1')
    insert into temp_table_final values(1,'19O','101','SGC','IXP','2015/01/01','2015/01/01','00:00:00','01:00:00',1,10,60,'02:00:00','101','19O-1')
    insert into temp_table_final values(2,'19O','102','SGC','IXP','2015/01/01','2015/01/01','00:30:00','01:30:00',2,10,60,'02:30:00','102','19O-2')
    insert into temp_table_final values(3,'19O','103','SGC','IXP','2015/01/01','2015/01/01','02:30:00','03:30:00',3,10,60,'04:30:00','103','19O-3')
    insert into temp_table_final values(4,'19O','104','IXP','DFW','2015/01/01','2015/01/01','03:30:00','04:00:00',4,10,60,'05:00:00','101','19O-1')
    insert into temp_table_final values(5,'19O','105','IXP','DFW','2015/01/01','2015/01/01','04:30:00','05:30:00',5,10,60,'06:30:00','102','19O-2')
    insert into temp_table_final values(6,'19O','106','DFW','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',6,10,60,'07:00:00','104','19O-1')
    insert into temp_table_final values(8,'19O','108','DFW','ABC','2015/01/01','2015/01/01','07:00:00','08:00:00',8,10,60,'09:00:00','105','19O-2')
    insert into temp_table_final values(9,'19O','109','ABC','DEF','2015/01/01','2015/01/01','10:00:00','11:30:00',9,10,60,'12:30:00','106','19O-1')
    insert into temp_table_final values(1,'319','111','PQR','STU','2015/01/01','2015/01/01','00:00:00','01:00:00',11,11,60,'02:00:00','111','319-1')
    insert into temp_table_final values(2,'319','211','PQR','STU','2015/01/01','2015/01/01','04:30:00','15:30:00',12,11,60,'16:30:00','211','319-2')
    insert into temp_table_final values(3,'319','112','STU','ABC','2015/01/01','2015/01/01','05:00:00','06:00:00',13,11,60,'07:00:00','111','319-1')
    insert into temp_table_final values(4,'319','212','STU','DEF','2015/01/01','2015/01/01','06:00:00','07:00:00',14,11,60,'08:00:00','212','319-3')
    insert into temp_table_final values(5,'319','213','STU','PQR','2015/01/01','2015/01/01','07:00:00','08:00:00',15,11,60,'09:00:00','213','319-4')
    insert into temp_table_final values(6,'319','118','STU','XYZ','2015/01/01','2015/01/01','10:00:00','11:30:00',16,11,60,'12:30:00','118','319-5')
    insert into temp_table_final values(7,'319','119','DEF','JKL','2015/01/01','2015/01/01','13:00:00','15:00:00',17,11,60,'16:00:00','212','319-3')
    insert into temp_table_final values(8,'319','215','ABC','MNO','2015/01/01','2015/01/01','17:00:00','20:00:00',18,11,60,'21:00:00','112','319-1')
    What we are doing here is generating a schedule for Trains departures.
    here, we should identify the train schedules making a chain of stations considering the endstation of a train engine no should be startstation of another record for same engineno. also the starttime of engineno should be nearest of nextstarttime
    of same station. 
    for example : if we pick Ist row "SGC-IXP", nextstarttime for same is "02:00:00 am". this means train departed from SGC will reach to IXP and is available for departure from IXP after "02:00:00 am". So we have to consider
    the record having startstation as IXP and nearest starttime to nextstarttime ("02:00:00"). So the next train departure would be IXP-DFW having starttime as "03:30:00 am".
    here you can see we have to assign the scheduleno of previously considered record to the chained schedule so we have updated the "schedule_ref" as 101. Also we have to assign the engine no - <counter of integer> to a single chain on schedule
    given in engine_ref.
    Regards
    Kumud

  • How do i use PL/SQL function in filter operator

    Hi,
    i want to use one pl/sql function in filter operator. how do i use it in filter condition.
    error i am getting is
    " error occured during expression validatation.
    my filter condition is
    INOUTGRP1.LAST_UPDATE_DATE > "GET_LAST_UPDATE_DATE"()
    can any one suggest me what is the problem for this error.
    Regards,
    Jyothy

    I tried and getting the same error. don't know why!!
    However, There is another way of accomplishing it.
    You can add a "Mapping Input Parameter" to your mapping and in the default value field call the function "Get_Last_Update_date". Then add the output field from this operator to the filter operator. Then edit the filter condition to replace the function call with output value from the Input parameter operator.
    This should work...

  • Using HANA SQL Functions in select list of CDS Views

    Dear Expert,
    Kindly please let me know if we can use the HANA SQL Function (Ex: ADD_DAYS, SECONDS_BETWEEN) in the select list of CDS Views?
    If I create a CDS like below I get error that timestamp is not supported.
    For Example:
    @AbapCatalog.sqlViewName: 'ZMR_H_CA'
    @EndUserText.label: 'CAG A'
    define view viewname
    with parameters start_ts:abap.dec( 15, 0 ) , end_ts:abap.dec( 15, 0 )
    as select from table {
    key resource_key,
    TO_TIMESTAMP(begtstmp) as start_tmp,
    TO_TIMESTAMP(begtstmp) as end_tmp
    where
    (begtstmp > $parameters.start_ts or endtstmp > $parameters.start_ts )
    and
    (begtstmp < $parameters.end_ts or endtstmp < $parameters.end_ts )
    Thanks,
    Giri

    Hi Giri,
    the list of provided features can be found in the ABAP Language Documentation (F1 in the CDS View).
    As CDS in ABAP is abstracted from the database layer, the database features are not directly accessible. That means, you cannot use any HANA or MaxDB feature available. So the answer to your question is no. The reason for this is, that ABAP CDS views can be created on all SAP-supported databases, hence, we can only provide those features, supported by all databases.
    Having said this, there are some exception, e.g. the CDS views with input parameters, which are not supported by all databases. In these cases, you'd have to additionally use the utility class CL_ABAP_DBFEATURES (see http://scn.sap.com/community/abap/blog/2014/10/10/abap-news-for-740-sp08--abap-core-data-services-cds) for more details.
    Best,
      Jasmin

  • Schedule a Workbook using PL/SQL Function.

    Hi,
    Trying to schedule a workbook which uses a PL/SQL function(the function inserts some values to a custom table).
    Workbook when run in desktop works fine and am able to see the results. but when run as a scheduled workbook it results with an error: Single query returns multiple rows.
    Any Ideas to get around this problem...
    Thanks!
    Nani.

    There could be a multitude of problems. Somewhere, the PL/SQL is selecting data using a SELECT ... INTO ... FROM type construct. Problem is that multiple records are being returned, and the code wants a cursor or some other mechanism.
    Look at the places where the PL/SQL is selecting data, and make sure that only 1 row is being returned. The PL/SQL code may need to be modified to purge data before or after to ensure subsequent runs will not be a problem. There could also be a commit statement out of place that isn't committing a deletion, or is preventing a rollback.
    With the way the workbook is scheduled, the PL/SQL could get called multiple times, but this seems unlikely as it works fine in desktop.

  • Error in report when executing pl/sql function body returning sql query.

    Hi,
    I have used the pl/sql function body returning sql query for creating a report. I have created a datepicker(
    P10_TASK_DATE) which can be submitted.The code is as below
    DECLARE
    v_sql varchar2(3000);
    BEGIN
    if :P10_TASK_DATE is not null THEN
    v_sql:='select
          * from tasks';
    return v_sql;
    else
    v_sql:='select * from discovery';
    return v_sql;
    END IF;
    END;if the date field is empty "select * from discovery" is executed and report is getting generated. But when we give a
    date using date picker the page is submitted and i get "report error: ORA-01403: no data found" even
    though the "tasks" table has data in it. Plz help
    Thanks,
    TJ

    hi
    Please try this
    1. Create 2 region
    1st region source=
    select * from tasks'
    go to the tab -> condition =
    item NOT NULL
    EXpression1 =:P10_TASK_DATE
    this will run whenever the item have any date
    2. open your 2 nd region source code= select * from discovery
    put the condition
    item is  NULL
    EXpression1 =:P10_TASK_DATE
    thanks
    Mark Wyatt

Maybe you are looking for