How to apply sort on an already dispaled resultset from a procedure

Hi,
I have a data block for which the 'query data source type' is PROCEDURE. When I query the block all the records in the procedure are displayed. Then I query for a specific value for the DATE column (ex: 27/07/2010) and it displays records for only 27/07/2010. Now I want to sort the displayed records.
My columns are DATE, TRANSACTION NUMBER, PROJECT CODE
I have a button each for DATE, TRANSACTION NUMBER, PROJECT CODE to do the sorting. When I click on the PROJECT CODE sort button , the already retireved records for 27/07/2010 must be sorted according to project code.
But this is not happening. The current coding will query the data block for all the records and then apply the sorting for DATE column.
Please advise.

Actually i don't know but what i gave u but i have read that If you attempt setting the where clause in the block it is totally ignored.
i hardly search just found the following...
Subject:  How to Filter Rows on Block Based on Stored Procedure in Oracle Forms? 
  Doc ID:  Note:1078147.6 Type:  PROBLEM 
  Last Revision Date:  22-JUN-2004 Status:  PUBLISHED 
Problem Description: 
==================== 
Whilst in ENTER QUERY mode you would like to specify a search criteria to 
restrict the results of your query.  The block on which this query resides
is based on a stored procedure. 
Problem Explanation: 
==================== 
If you attempt setting the where clause in the block it is totally ignored. 
This happens with both the 'Ref Cursor' or 'Table of Records' variable.    
Problem References: 
=================== 
[Search Words: filter ]
Solution Summary: 
=================
With Forms 5.0 and above, you can use the Tools--> Datablock Wizard menu 
in the Object Navigator to enter the datablock wizard in a re-enterant mode.
You can then specify the query criteria there. 
Alternatively, you can pass the query criteria from Forms to the stored 
procedure as an IN argument. You can then use the parameter with the 
select statement (in the procedure you have created using the 'Table of Records
or 'Ref Cursor').
Solution Description: 
===================== 
If the blocks were created using the Datablock Wizard with the
"stored procedure" radio button, you can always re-enter the datablock wizard
for that block by clicking on the Tools-->Datablock Wizard. If you go to the 
Query tab on the bottom of the tab page you will notice that it requests the 
name of the parameter. This is where you enter -
   :parameter.<parameter_name> 
This method relies on having a parameter in the form that passes the 
value, for example p_deptno, into the stored procedure. This is done in order
to get the corresponding records from the emp table for all employees who work
in that deptartment.
Additionally create a PRE-QUERY trigger and assign the value of the deptno you 
are passing through this parameter using the following:
   (:parameter.<parameter_name>:= :dept.deptno).
If the blocks were created manually, however, YOU CANNOT use the re-enterant 
option to go to the Datablock Wizard. For these type of blocks, use the method
suggested below.
METHOD FOR MANUALLY CREATED BLOCKS:
===================================
Re-enter the Datablock Wizard by using the Tools--> Datablock Wizard menu of the 
Object Navigator.  You will notice that you will not be able to see any 
procedure in the Datablock Wizard in re-enterant mode.
To use this method, you will need to include one more parameter to your query
procedure as an IN parameter. For example, if you are passing deptno as query
criteria, click on the "Query Data Source Arguments" of your block property 
sheet and include the following:
    ARGUMENT NAME: set to  P_DEPTNO or (any variable name)
    TYPE: set to the appropriate datatype, for example, NUMBER
    TYPENAME: set to dept.deptno%type, for example
    MODE: set to IN
    VALUE: set to :dept.deptno(the :blockname.itemname you are passing
                               as query criteria.).
In the query procedure, include this parameter as an IN argument, and as the 
2nd parameter.  For example:
    Procedure  empquery_refcur(emp_data IN OUT empcur, v_dno IN number) AS ....
Finally, include this paramter in your select statement of either 'Table of 
Records' or 'Ref Cursor' as
    select empno, ename
     from emp
      where deptno=nvl(v_dno, deptno);But no chance to Sort it may be from inside the procedure itself.
Hope this helps...
Regards,
Abdetu...

Similar Messages

  • How can I sort movies by genre on itunes  from ipad 2 ?

    If i find a movie for buy in itunes ( from pc ) i can select the genre (action , comedy ..) for optimize the search. In mi ipad 2 i cannot do this  , i can select genre for music , apps , etc but in movies i only see alphabetical order and older / news movies .
    How can I sort movies by genre on itunes  from ipad 2 ?¿
    Thans very much ¡

    I'm looking for an answer to this same question.  I can sort (group) by Genre on iTunes and Apple TV - but not by brand new iPad 2...? 

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • How to apply sorting for each level of a hierarchy?

    I'm using SSAS OLAP and I want to apply sorting of the levels of a hierarchy.
    I know that I can sort the whole hierarchy via ORDER function (I have some issues when I'm trying to apply DESC sorting
    on the whole hierarchy), but what I really want to achieve is sorting of a specific level. For example in the [Date].[Calendar] hierarchy (Adventure Works Cube), I want to have ASC sorting
    of years, DESC sorting of Quarter, ASC sorting
    of Months, etc. I do not want to break the hierarchy (using BASC or BDESC), I just need them sorted on the same level. Do you have an idea if this is possible at all?
    My idea is to sort the levels based on their key, not by the measure. For example if we have the following structure:
    -2009
     -Q1
       -Jan
       -Feb
     -Q2
       -May
       -June
    -2010
     -Q1
       -Jan
       -Feb
     -Q2
       -May
       -June
    I would like to be able to sort the data in the following order (DESC for years, ASC for Quarters, DESC for months):
    -2010
     -Q1
       -Feb
       -Jan
     -Q2
       -June
       -May
    -2009
     -Q1
       -Feb
       -Jan
     -Q2
       -June
       -May 
    Thanks in advance for your help!

    Hi Rosen,
    According to your description, you want to sort the different hierarchy members in different order, right? Generally SQL Server Analysis Services doesn't provide a way to sort dimension members in Descending order. SSAS provides only Ascending order. We
    can achieve this sort functionality by using a simple trick. However, the order is used for all the members of different hierarchy under this dimension. So I'm afraid that your requirement cannot be achieved. 
    Reference:Sort Dimension Members in DESCending order
    Thank you for your understanding.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Applying sort to a query returned by a stored procedure

    I am looking for some advice on the best approach for applying a dynamic sort to a query returned by a stored procedure.
    We have a stored procedure that has 3 inputs fields which are used to specify sort columns and it has an additional 3 fields to indicate if the corresponding input column is to be sorted in ascending or descending order. We presently accomplish this by using dynamic SQL in the procedure but this approach has some drawbacks. Ideally we would like these queries to compile just like any other cursor. We have tried using decodes but this does not seem practical or easy to maintain.
    This procedure is used by a web application that allows the user to click on a column header to specify their sort preference. The previous sort selection becomes the second sort field and the one before that the third.
    Your advice is much appreciated!

    I see, so you want to be able to sort by "name desc, age asc, salary asc", for example.
    there is no built in option. it's either dynamic sql, or decodes.
    the decodes could still work, with only 6 lines, but the problem is handling mixed data types. I'll stick with sort col of 1=name (char), 2=number_col, 3=date_col
    order by
      decode(sort_order1, 'A', decode (sort_col1, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
      decode(sort_order1, 'D', decode (sort_col1, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,
      decode(sort_order2, 'A', decode (sort_col2, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
      decode(sort_order2, 'D', decode (sort_col2, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,
      decode(sort_order3, 'A', decode (sort_col3, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
      decode(sort_order3, 'D', decode (sort_col3, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,Message was edited by:
    shoblock
    forgot to make 3 asc/desc variables

  • How to get a resultset from Stored Procedures

    How to efficiently and portably get resultsets from Oracle stored procedures? Oracle does not seem to follow JDBC standards here. A standard way in Oracle is to use a ref cursor and call getObject() on CallableStatement. However, Oracle seems to get all the data in the resultset in getObject(), which is inefficient and leads to large memory usage when the resultset is large.
    Another way in Oracle is to use getCursor() on an OracleCallableStatement, which is efficient but not portable across different application servers. For example, in WebSphere, this OracleCallableStatement is not available if we want WebSphere to manager the datasource.
    Any ideas will be greatly appreciated. Please email to [email protected]

    Oracle JDBC did not support return a result set, if you are using Oracle 9i, you can use pipeline function, then using the TABLE() function the get the row.
    Good Luck.
    Welcome to http://www.anysql.net/en/

  • How do I sort music in iTunes when played from iPhone?

    Okay, so I've been using my iPhone to basically carry music around and play it on different computers, right?  Just turn on manual sync and then I can play music on iTunes straight from my music library without needing to have it in my computer's iTunes library.  The problem is that all the music is out of order, and the column headers at the top that should be clickable to choose how you want the music to be sorted are all greyed out and unclickable.  What I want is for my music to be sorted by Album Title followed by Track Number.  Used to be that it was sorted by Artist then Track Number, which usually ended up okay as long as the album only had one artist.  But recently, iTunes just completely arbitrarily changed itself to sorting by Song Title, which is screwing everything up.  Since the sorting order can obviously be changed, how do I get iTunes to sort the music from my iPhone in a sensible fashion?

    Here's an article about synching (moving your music) with a new computer: http://support.apple.com/kb/HT4527

  • How can i sort out the N lowiest elements from an 1D array faster than using the build in sort function (1D-array) in Labview?

    I need an algorithm that is based on the same sorting-algorithm that Labview uses (or one that is just as fast) but it only needs to sort out the N lowiest elements (and the N-element output array don't need to be sorted).
    /Jonas

    I want all three zeros in the output. You can se the algorithm that I'm looking for as a soft version of Labviews own sort algorithm that only gives you the N (always less then the length of the array) lowiest values as output.If two elements contain the same small value both should be sorted out.
    /Jonas

  • How to call reports 6i or forms 6i directly from oracle procedure

    Hi,
    Hi,
    Env: 6.0.8.25.2 (forms 6i/reports 6i)
    Database: Oracle 10g r2
    We are running a client server environment and not web based.
    I want to run the forms 6i or reports 6i directly from a database procedure/function and not by creating a procedure inside a form and then call a report.
    Looking for calling forms6i/reports 6i directly from sql*plus commands used inside the PLSQL database procedure/function. (Just like we create a stand alone package/procedure/function).
    I have developed many forms and reports and very comfortable in calling reports from forms 6i.
    My question was completely different but looks like i was not able to explain properly:
    I want to call the forms 6i or reports 6i directly from sqlplus* prompt and through stand alone oracle database procedure/function (procedure created directly in database but not as a program unit within form or report).
    There is a requirement to call the form through database scheduling by passing fixed parameters and then generate the report pdf and email automatically to various users.
    Also, is there any way to schedule a report automatically so that the report runs automatically in the scheduled time and send out reports to the users. I have developed a email program but looking for scheduling the report or forms 6i.
    Thanks,
    Srinivas

    Hi,
    There are couple of existing reports and forms developed in 6i and users are using them when required.
    For certain MIS reports, management wants them to be generated on daily/weekly basis and email to be sent to them as PDF files.
    Have a program which will convert to PDF and email to users but not able to trace on how to call the forms 6i or reports 6i and pass the report parameters so that the report is called directly through pl/sql so that i can schedule them.
    All the forms and report executables are located on server1 and database server is located in server2 and running on client/server architecture.
    Database version is 10g r2 and Forms/Reports version is 6i.
    Any code samples would be of great use.
    Srinivas

  • How to fetch 2 set of records in MII from SQL procedure

    Hi Experts,
    I am invoking a SQL procedure from MII which return 2 set of records. But at MII I am able to get only first set of records. Is there any configuration required at MII side or SQL side to get both set of records in MII?
    Here is the SQL Query Structure
    Create procedure Sample_Proc
      @Param1 Varchar(10),
      @Param2 varchar(10),
      @Param3 Varchar(20) OUT,
      SET INCOUNT ON;
    AS
    Begin
      *//Selection statements//*
    END
    SP Executing in MII
    Declare @Param1,
      @Param2,
      @Param3,
    Exec Sample_Proc
      @Param1='name',
      @Param2='Id',
      @Param3=@Param3 OUTPUT,
    Select @Param3
    Our SP is returning values (Say Recordset1)based on the input parameters 1 and 2 , along with Parameter3 value(Say Recordset2) in MS SQL server but in MII its returning only the values(Recordset1) ... how to fetch recordset2 values in MII
    I hope MII can return 2 set of records (rowsets) after executing the procedure.
    MII version -> 12.2.3 Build(182)
    Thanks & Regards,
    Rajasekhar Kantepalli

    Hi Swaroop,
    With MII 14.0 SP5 Patch 11, in a transaction, I get following XML output for a query that executes an SP(returning multiple resultSets) :
    And, results in this format can surely be used for further processing in an MII transaction.
    Thanks Rajasekhar, got to know about this because of your query.
    regards,
    Manisha

  • How do I read a report's XML Output from a procedure?

    I am using E-Business suite 11.5.10.2 and XMLP 5.5. I have a report that will output XML. When this report is run, I can click the 'View Output' button and view the XML. This appears to be a temp file somewhere, because the temp id in the URL changes each time a new report is run. Here's my problem: After running this report, I want to execute a procedure that will loop through the XML output and transform it into HTML. I will then output this HTML to the screen. But I'm not sure how to pass this file as a parameter to my procedure.
    Is there anyway to allow a procedure to consume the XML output?
    The reason I'm trying to do this, is because we need to transform certain reports into Excel format. This is becoming a critical issue. After testing, I found that if I can extract data into an HTML table and display it on the screen, it dumps perfectly into Excel. I tested it using a cursor, but that won't work for production reports. There is a ton of logic built into these Oracle reports, so I need to go the XML route after running the report.
    Looking at previous posts, the current Excel output process seems to be a bit buggy. And, we can not upgrade to Excel 2003 at this time.
    Any ideas would be greatly appreciated!!!
    Thanks.
    Mark K

    Hello Klaus. I appreciate your response. While I'm no expert with XMLP, I have created about 8 production reports using XMLP. I am using XMLP 5.5, and not 5.6.1 I am using Excel 2002 and not Excel 2003. From other posts (shown below), it is my understanding that the Excel output may have bugs unless you're using XMLP 5.6.1 and Excel 2003.
    Please see the following posts for more information:
    Re: EXCEL output not displaying properly
    Excel output in 5.6 version
    Also, when I tried to output to Excel using my desktop version, I received an error message. But, when I switch to PDF format, it opens just fine.
    We are not prepared to upgrade Excel and/or install another patch for XMLP at this time. If I can do what I need to do programmatically, I will have much more leverage when it comes to troubleshooting. On the other hand, when I run into a bug with Oracle software, I usually have to wait for a patch.
    Thanks again.
    Mark K.

  • How to construct table in jsp for the resultset from helper class

    Hi Dudes!!!
    Want to construct table in jsp for the resultset, but the resultset are retrieved at the helper class.I constructed Table in Helper class Using StringBuffer and return it as string from the helper class.Is their any other feasible and efficient way to construct table in Jsp for the resultset from Helper class.Solution will be highly appreciated.Thanx in Advance.

    no, we can't.
    Certainly noone can with such vague specifications even if they had the intent to do so.
    "the computer", which computer?
    "attach to our current page", what is meant by that?
    And noone should ever help you if you're planning to breach security anywhere.

  • How do you sort video in itunes

    in itunes you have the video section then you have 4 subsections Movies,Music Videos, Podcasts, and Tv Shows.
    How do you sort the different video in itunes from all vidoes to those subsections

    ben7072 - I just found this on the discussions board: "Under View Options in the View menu, check the box that says Artist. Then rearrange your shows by Artist instead of Show."
    It does work. Obviously, the Artist needs to be the same a Show for it to truly fix our problem here... this is the case for me.
    I'd still like to know what the real problem is though...
    iMac G5   Mac OS X (10.4.9)  

  • SIU - Apply Computer Name and Local Hostname settings from a file

    I am setting up a workflow to image corporate computers and wanting to know how the "Apply Computer Name and Local Hostname settings from a file" works in the Apply System Configuration Settings task.
    We bind the computer to AD and OD and we have a specific naming convention for certain departments and trying to automate the entire imaging process.
    Would this be something that can be done with SIU?

    Well, maybe there's a bug in the latest version (10.5.3) of SIU as this is not what is happening.
    It doesn't seem to matter what I specify for the name parameters I end up with a Bonjour name of ".local".
    I put in a line of the form <Mac Address><TAB>tom<TAB>dick<TAB>harry into the text file used by the Apply System Configuration Settings Action.
    and end up with hostname = tom, Computer Name = dick and Bonjour Name = .local
    I'm building the NetInstall image on a new iMac running 10.5.3 booted out of a second partition and create the image from the main boot partition (also 10.5.3). I then copy the image to my server (10.5.3) and make a second iMac boot up from the NetInstall image.
    For what it is worth the Workflow Actions I am using are:
    Define Image Source
    + NetInstall
    Source: Macintosh HD
    Filter Clients by MAC Address
    + Allow
    <List of MAC Addresses>
    Enable Automated Installation
    + On Volume Named: Macintosh HD
    + Erase before installing
    + Primary Language: English
    Apply System Configuration Settings
    + Apply Computer Name and Local Hostname settings from a file: <FILE>
    Add Packages and Post-Install Scripts
    + Shell Script [Doesn't work - we're discussing in it in another thread]
    Create Image
    In: Public
    Named: NetInstall Classroom
    Volume Name: Classroom iMacs
    Index: 1

  • How to apply a Character Style that's already been made in a template document?

    First of all I'd like to thank everyone that helps. I'm a complete beginner at scripting and appreciate all your help.
    I'm basically using GREP expressions to find patterns in a document and apply a Character Style which has already been made. This Character style was not made using script, but just in InDesign when making and setting up the template.
    var myDoc = app.activeDocument;
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //GREP Expression for finding all HEADERS
    app.findGrepPreferences.findWhat = ".+\n";
    //Applying formatting changes to put into All Caps, Bold and changing the font size to 12 pt.
    app.changeGrepPreferences.capitalization = Capitalization.allCaps;
    app.changeGrepPreferences.fontStyle = "Bold";
    app.changeGrepPreferences.pointSize = "12";
    myDoc.changeGrep();
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    This is how I currently have it. I will manually define the changes to the text. The problem is, each template uses a different set of fonts and not all of them use Bold e.g. Sabon can use CE Bold.
    I would like to learn how to apply a Character Style and have tried looking around but nothing seems to work.
    Any help would be much appreciated.
    Thanks.

    select the text where u went  and run below  script after change group as per ur template.
    var myDoc = app.activeDocument;
    var mySel = app.selection[0];
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //GREP Expression for finding all HEADERS
    app.findGrepPreferences.findWhat = "role";
    //Applying formatting changes to put into All Caps, Bold and changing the font size to 12 pt.
    //app.changeGrepPreferences.capitalization = Capitalization.allCaps;
    //~ app.changeGrepPreferences.fontStyle = "Bold";
    //~ app.changeGrepPreferences.pointSize = "12";
    app.changeGrepPreferences.appliedCharacterStyle=myDoc.characterStyleGroups.item("Style Group 1").characterStyleGroups.item("Style Group 2").characterStyles.item("Header")// Header is name of character name
    mySel.changeGrep();
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    If it's help then click yes
    Mi_D

Maybe you are looking for

  • Reg UTL_FILE error

    hi all, iam using utl_file in my procedure.while executing the script its showing error as ERROR at line 1: ORA-29280: invalid directory path ORA-06512: at "SYS.UTL_FILE", line 33 ORA-06512: at "SYS.UTL_FILE", line 436 ORA-06512: at line 1 ORA-06512:

  • Greater than operator for obiee analysis

    Hi ALL, Just want to ask if it is possible to use date for the greater than operator in creating obiee analysis? for example: I want to get months greater than January 2015 for specific measure. Thanks in advance

  • How to sync my pics from my old phone with icloud

    My pictures started syncing over wifi but stopped at 268 of 516 what should I do it's been 3 days

  • Xml file comparison

    hi all, can anybody help in coding for comparing two xml files which are the outputs of OCR system that we r developing

  • Swapping the server in ASM.

    Hi All We are going to upgrade our sun servers from v40z to x4600.We are using ASM for our database. We are doing the server migration on our test system. We are copying the binaries from old server to new server all other associated files /var/opt/o