Get all Persons via Database select

Hello all,
if you ever need to get all Persons and its string values in an easy way directly from your database such as the xpath select
" Select * from /Person" use following Database select against your FimService Database:
--determine dynamically the columns for pivot
DECLARE @cols AS NVARCHAR(MAX),
@query  AS NVARCHAR(MAX)
select @cols = STUFF((SELECT ',' + QUOTENAME(Name)
                    FROM [fim].[ObjectValueString] AS [o]
                    INNER JOIN [fim].[AttributeInternal] AS [ai]
                    ON [ai].[Key] = [o].[AttributeKey]
                    WHERE            
                    [o].[ObjectTypeKey] = 24   
                    group by Name FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'')
set @query = N'SELECT ' + @cols + N' from
             (SELECT        
                [ai].[Name],
                CAST ([o].[ValueString] AS NVARCHAR(MAX)) as Value,
                ROW_NUMBER() over(partition by [ai].Name order by [o].[ValueString]) rn
                FROM [fim].[ObjectValueString] AS [o]
                INNER JOIN [fim].[AttributeInternal] AS [ai]
                ON [ai].[Key] = [o].[AttributeKey]
                WHERE       
                [o].[ObjectTypeKey] = 24 --Type for Persons
             ) x
             pivot
                Max(Value)
                for Name in (' + @cols + N')
             ) p '
exec sp_executesql @query;

You could create new stored procedures which do not use the additional search criteria.
For example: sp_get_all_room_names()
or: sp_get_all_room_numbers()
Alternately, when searching by ints, your stored procedure could accept a max and a min value. Your Java class which calls this stored proc could intelligently search for one value (both min/max the same) or all values (pick decent min/max values).
For example: sp_get_room_numbers(min, max)
I hope this gives you a few ideas to run with.

Similar Messages

  • Get all records in multi selected master child tables

    Hi,
    I am using JDeveloper 11.1.1.4 version and using ADF-BC in my project.
    I have a simple master child[one to many] relationship in my project.
    In my view page,I display this master child [Ex: EmpVo1--->DeptVo2] as tables.
    I have multi-slection enabled for master table.
    My requirement is that,on multi selecting the rows in master tables,I want to get all the child records in my backing bean.
    that is if a master row has 3 child records and another master row has 4 child records and on multiple selection of these two records in master table,I should get all the child records in my backing bean.
    I need this to implement cascade delete functionality.
    Following is sample piece of code
    1) called on selecting the rows in master table
    public void onRSCGrpSelect(SelectionEvent selectionEvent) {
    // Add event code here...
    ADFUtil.invokeEL("#{bindings.RscGroupVO1.collectionModel.makeCurrent}",
    new Class[] { SelectionEvent.class },
    new Object[] { selectionEvent });
    RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    Row row = rowData.getRow();
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    System.out.println("Displaying Child Records");
    displayChildRecords(row.getAttribute(0));
    2. private void displayChildRecords(Object rscGrp) {
    ViewObject rscMapVo = getRscMapViewObj();
    RowSetIterator rsI = rscMapVo.createRowSetIterator(null);
    while (rsI.hasNext()) {
    Row row = rsI.next();
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    rsI.closeRowSetIterator();
    But the problem is that ,it is always giving me the last selected rows child record details
    Please suggest the error I am doing.
    Thanks,
    Praveen

    Your problem is that you use makecurrent, which should not be used on a multi select table. Next if you have master detail relationship you should have a view link between them. In this case you can expose a method in you master to get the related child row. No need to get the VO itself as you can use the child iterator accessors to get the child record.
    public void onRSCGrpSelect(SelectionEvent selectionEvent) {
    // Add event code here...
    RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)tblRSCGrp.getValue();
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding)cm.getRowData();
    Row row = rowData.getRow();
    //cast to the right row class
    EmpEmpVoRow empRow = (EmpEmpVoRow) row;
    // now you cann access the child row iterator
    RowSetIterator it = empRow.getDepVO();
    //now you cna iterate over the child rows
    System.out.println("\n" +
    row.getAttribute(0) + " :: " + row.getAttribute(1) +
    " :: " + row.getAttribute(2));
    System.out.println("Displaying Child Records");
    //use hte child rows here
    }Not sure if the code compiles out of the box (doing this on the train :-)
    Timo

  • Get all values from multi select in a servlet

    Hello,
    I have a multi <select> element in a HTML form and I need to retrieve the values of ALL selected options of this <select> element in a servlet.
    HTML code snippet
    <select name="elName" id="elName" multiple="multiple">
    Servlet code snippet
    response.setContentType("text/html");
    PrintWriter out = null;
    out = response.getWriter();
    String output = "";
    String[] str = request.getParameterValues("elName");
    for(String s : str) {
    output += s + ":";
    output = output.substring(0, output.length()-1); // cut off last deliminator
    out.println(output);But even when selecting multiple options, the returned text only ever contains the value of the first selected option in the <select>
    What am I doing wrong? I'm fairly new to servlets
    Edited by: Irish_Fred on Feb 4, 2010 12:43 PM
    Edited by: Irish_Fred on Feb 4, 2010 12:44 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:14 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:32 PM

    I am using AJAX.
    I will show you how I'm submitting the <select> values by showing you the flow of code:
    This is the HTML code for the <select> tag and the button that sends the form data:
    <form name="formMain" id="formMain" method="POST">
         <input type="button" id="addOpts" name="addOpts" value="Add Options" style="width:auto; visibility:hidden" onClick="jsObj.addOptions('servletName', document.getElementById('elName'))">
         <br>
         <select name="elName" id="elName" multiple="multiple" size="1" onChange="jsObj.checkSelected()">
              <option value="0"> - - - - - - - - - - - - - - - - </option>
         </select>
    </form>Note that the "visibility:hidden" part of the button style is set to "visible" when at least one option is selected
    Note that "jsObj" relates to a java script object that has been created when the web app starts ( The .js file is included in the .jsp <head> tag )
    The following code is taken from the file: "jsObj.js"
    jsObj = new jsObj();
    function jsObj() {
    //=================================================
         this.addOptions = function(url, elName) {
              var theForm = document.getElementById('formMain');          
              if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
                   xmlhttp=new XMLHttpRequest();
              } else { // code for IE6, IE5
                   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              url += this.buildQueryString(theForm.name);
              xmlhttp.open("POST",url,true);
              xmlhttp.send(null);
              xmlhttp.onreadystatechange=function() {
                   if(xmlhttp.readyState==4) { // 4 = The request is complete
                        alert(xmlhttp.responseText);
    //=================================================
    this.buildQueryString = function(formName) {
              var theForm = document.forms[formName];
              var qs = '';
              for (var i=0; i<theForm.elements.length; i++) {
                   if (theForm.elements.name!='') {
                        qs+=(qs=='')? '?' : '&';
                        qs+=theForm.elements[i].name+'='+escape(theForm.elements[i].value);
              return qs;
         //=================================================
    }And this is a code snippet from the "servletName" servlet:public synchronized void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,IOException {
              PrintWriter out = null;
              try {
                   response.setContentType("text/html");
                   out = response.getWriter();
                   String output = "";
                   String[] values = request.getParameterValues("elName");
                   for(String s : values) {
                        output += s + ":";
                   output = output.substring(0, output.length()-1); // cut off last delimitor
                   out.println(output);
                   } catch (Exception e) {
         }So anyway, everthing compiles / works, except for the fact that I'm only getting back the first selected <option> in the 'elName' <select> tag whenever I select multiple options
    Edited by: Irish_Fred on Feb 7, 2010 10:53 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get all the index of "selected rows" in table control?

    Hi Gurus,
    I have a table control, wherein I need to get selected row so that I can get its respective TABIX.
    I know that the event for capturing selected row is in PAI.
    I also ensure that the w/ selColumn name in my screenpainter is exactly the same as my declaration in ABAP.
    TOP INCLUDE
    YPES: BEGIN OF Y_ZQID_CHECK,
            IDNUM           TYPE ZQID_CHECK-IDNUM,
            WERKS           TYPE ZQID_CHECK-WERKS,
            MATNR           TYPE ZQID_CHECK-MATNR,
            LICHA           TYPE ZQID_CHECK-LICHA,
            LIFNR           TYPE ZQID_CHECK-LIFNR,
            ECOA_S          TYPE ZQID_CHECK-ECOA_S,
            ID_STAT         TYPE ZQID_CHECK-ID_STAT,
            ID_DATE         TYPE ZQID_CHECK-ID_DATE,
            FLAG_MAILCOA(1) TYPE C,
            MARK(1)         TYPE C, "Name of w/ SelColumn in ScreenPainter: T_ZQIDCHECK_DISCH-MARK
           END   OF Y_ZQID_CHECK.
    DATA: T_ZQIDCHECK_DISCH TYPE STANDARD TABLE OF Y_ZQID_CHECK WITH HEADER LINE.
    PAI
    PROCESS AFTER INPUT.
    * MODULE USER_COMMAND_9004.
    LOOP AT T_ZQIDCHECK_DISCH.
      MODULE READ_TC_DISCH .
    ENDLOOP.
    module READ_TC_DISCH input.
      DATA: W_LINE_SEL TYPE SY-STEPL,
                  W_TABIX    LIKE SY-TABIX.
      GET CURSOR LINE W_LINE_SEL.
      W_TABIX = TC_ID_ONLY-TOP_LINE + w_LINE_SEL - 1.
      MODIFY T_ZQIDCHECK_DISCH INDEX TC_ID_ONLY-current_line.
    If I am selecting single row, I can properly get the selected index via debug.
    BUG:
    When I'm selecting multiple rows in table control, only the last row is always being read inside the loop of my table control.
    Please see the screenshot.
    [url]http://img268.imageshack.us/img268/5739/tcselectedrows.jpg[url]
    Notice in the debug screenshot, even if it's just in the 1st loop of table control, it automatically gets the 4th table control index, instead of the 2nd one.
    Helpful inputs will be appreciated.
    Thanks.
    Jaime
    Edited by: Jaime Cabanban on Dec 9, 2009 3:16 PM

    Hi,
    Are you sure that you have selected multiple line for tablecontrol in the property window of the tablecontrol.
    Flowlogic.
    LOOP WITH CONTROL TC_01.
         Module Get_Marked.
    ENDLOOP.
    Module Pool
    Module Get_Marked.
    read the data from the internal table where mark  = 'X'.
    this should give you only selected records.
    Endmodule.
    Kindly check the tablecontrol property.
    Regards,
    Ranjith Nambiar

  • How to get all request from database between two dates in servlets

    I am having a servlet in which i am I accepting two form values i.e 'fromdate' and 'todate' by using req.getParameter(fromdate & todate).
    Now i have to query a table called REQUEST which has 4 columns like req_id, name, createdate and status.
    In the servlet I would like to retrieve all the request during that period say for example. between 1st July to 31stJuly, and then display it on the browser with all req_id(first column in the table) having a hyperlink to another XML file which consists of all the details when a user had send his request in the month of July.
    The output on the browser is preferable in a Table format which has to be created dynamically depending the number of request.
    Kindly let me know how I can proceed with this .
    Thanks,
    Regards,
    Lijoy

    The topic seems a little broad.
    The SQL would look something like
    select req_id, name, createdate, status
    from request
    where createdate > fromdate and <= todate

  • Problem getting all parameters from multiple select

    I have a multiple select option box that's properly displaying all the values. I'm using getParameterValues() to retrieve all of the selections but it returns the string[] with only the first selection made.
    JSP:
    <select name="selectList" multiple="true" size="2">
    <option value="value1"> Select 1
    </option>
    <option value="value2"> Select 2
    </option>
    </select>Servlet:
    String[] subset = request.getParameterValues("selectList");I think all my code above is fine. Anything else that would cause getParameterValues() to only return the top selected item?
    Thanks!

    The HTML cod is written in incorrect syntax, the browser nor the Server will understand.
    If you write it in XHTML then the proper syntax is:
    <select name="selectList" multiple="multiple" >
    If you write it in plain old HTML then the proper syntax is:
    <select name="selectList" MULTIPLE >
    (I'm not sure about this HTML syntax, but definitely the XHTML syntax shown above is correct)

  • How to get all the measure names in a cube

    Hello,
    How can I get the list of all measures in a SSAS database or cube by MDX / XMLA.
    If I get the details like what are all aggregations used and under which folder the measures available that will be great.
    We can get the same by SQL and i would like to get the same from a cube.
    SQL:
    select column_name from information_schema.columns
     where table_name = 'MyTable'
    order by ordinal_position
    Regards,
    Palash

    Hi Palash
    Please see the belwo DMV (Dynamic Management View) which will get the same by SQL.
    All Cubes in database 
    SELECT [CATALOG_NAME] AS [DATABASE],CUBE_CAPTION AS [CUBE/PERSPECTIVE],BASE_CUBE_NAME FROM $system.MDSchema_Cubes WHERE CUBE_SOURCE=1
    All dimensions in Cube 
    SELECT [CATALOG_NAME] as [DATABASE], CUBE_NAME AS [CUBE],DIMENSION_CAPTION AS [DIMENSION]  FROM $system.MDSchema_Dimensions 
    WHERE CUBE_NAME  ='Adventure Works' AND DIMENSION_CAPTION  'Measures'
    --All Attributes 
    SELECT [CATALOG_NAME] as [DATABASE],  CUBE_NAME AS [CUBE],[DIMENSION_UNIQUE_NAME] AS [DIMENSION],  HIERARCHY_DISPLAY_FOLDER AS [FOLDER],HIERARCHY_CAPTION AS [DIMENSION ATTRIBUTE],  HIERARCHY_IS_VISIBLE AS [VISIBLE]  FROM $system.MDSchema_hierarchies 
    WHERE CUBE_NAME  ='Adventure Works' AND HIERARCHY_ORIGIN=2 
    All Hierarchies (user-defined) 
    SELECT [CATALOG_NAME] as [DATABASE],  CUBE_NAME AS [CUBE],[DIMENSION_UNIQUE_NAME] AS [DIMENSION],  HIERARCHY_DISPLAY_FOLDER AS [FOLDER],HIERARCHY_CAPTION AS [HIERARCHY],  HIERARCHY_IS_VISIBLE AS [VISIBLE] 
    FROM $system.MDSchema_hierarchies 
    WHERE CUBE_NAME  ='Adventure Works' and HIERARCHY_ORIGIN=1 
    All Measures 
    SELECT [CATALOG_NAME] as [DATABASE],  CUBE_NAME AS [CUBE],[MEASUREGROUP_NAME] AS [FOLDER],[MEASURE_CAPTION] AS [MEASURE],[MEASURE_IS_VISIBLE] 
    FROM $SYSTEM.MDSCHEMA_MEASURES 
    WHERE CUBE_NAME  ='Adventure Works'
    SUHAS http://suhaskudekar.blogspot.com/ Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • How to get assigned persons

    Hi Friends,
    How can i get assigned persons.
    If i provide superior ( user id OR Name OR personnel number ) i need to get all persons under that superior.
    Is there any BAPI or Function module or any standard report.
    And let me know the parameters also.
    Thanks,
    Kumar.

    Hello,
    I was able to get the logic to get the assigned persons using the table HRP1001. The below is the assumed logic (small modifications may be necessary).
    First the PERNR of A is to be found out(if only name of userid is available) from the table PA0105. Once the PERNR is available, get the position of A using the following code.
    SELECT SINGLE SOBID INTO V_SOBID
                    FROM HRP1001
                    WHERE OTYPE EQ 'P'
                    AND OBJID EQ OBJID
                    AND PLVAR EQ '01'
                    AND RSIGN EQ 'B'
                    AND RELAT EQ '008'
                   AND BEGDA LE DATUM
                   AND ENDDA GE DATUM
                   AND SCLAS EQ 'S'.
    Now get the subordinate positions who are one level under him using the below code.
    SELECT OBJID INTO TABLE I_OBJID
                            FROM HRP1001
                            WHERE OTYPE EQ 'S'
                            AND PLVAR EQ '01'
                            AND RSIGN EQ 'A'
                            AND RELAT EQ '002'
                            AND BEGDA LE DATUM
                            AND ENDDA GE DATUM
                           AND SCLAS EQ 'S'
                           AND SOBID EQ V_SOBID.
    Now get the pernr of the subordinate positions
      SELECT SINGLE SOBID INTO SOBID
                                           FROM HRP1001
                                          WHERE OTYPE EQ 'S'
                                          AND OBJID EQ OBJID  è from I_OBJID
                                          AND PLVAR EQ '01'
                                          AND RSIGN EQ 'A'
                                         AND RELAT EQ '008'
                                         AND BEGDA LE DATUM
                                         AND ENDDA GE DATUM
                                         AND SCLAS EQ 'P'.
    The userid's can be obtained from the table PA0105.
    Hope this will help.
    Regards,
    Sam

  • How to get all rows in table to red using alternate rows properties option

    How to get all rows in table to red using alternate rows properties option

    Hi Khrisna,
    You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
    I tried doing it and the colors freaked me out (all red) :-D
    Kindly tell me if im missing something.
    Regards,
    John Vincent

  • Ssrs 2008 'select all' option to be selected for a parameter

    In a new ssrs 2008 report, the problem is all reports are not selected from the parameter called 'report' when the report runs automatically.  When the report executes, there is nothing displayed in the parameter selection  dropdown box. The user
    has to click the down arrow to select which reports they want to execute.
    Here is the siutation for the ssrs 2008 report:
    In a new SSRS 2008 report, I want to be able to allow the user to select which report they  would like to see generated by selecting the report name from a dropdown list. This is a multi-valued parameter and the parameter name is called 'report'. I
    would like the default value to be for all 5 reports to be selected.
    All 5 reports will be on the 'main' report. There will be no subreports. Each report will have its own unique matrix and the matrix will be visibile based upon what is selected in the parameter called 'report'.
    My question is how can I make the 'default' value for the parameter called 'report' have all the reports selected?
     Normally to get all multivalued parameter values selected you create a dataset and run a query against a table. However in this case, there is no table to query. The user just selects what report(s) they want executed.
    Here is the code that is used:
    1.Right-click the multiple parameter ‘repot’ to open the Properties dialog box.
    2.Specify the values below in the Available values:
     Label: report1                                                
    Value: report1
     Label: report2                                                
    Value: report2
     Label: report3                                                
    Value: report3
     Label: report4                                                
    Value: report4
     Label: report5                                                
    Value: report5
    3.Specify the values below as the Default Values:
     report1   report2   report3   report4   report5
    4.Right-click the ‘report1’ to open the Tablix Properties dialog box.
    5.Select Visibility in the left pane, type the expression below in the “Show or hide based on an expression” textbox:
     =iif(InStr(join(Parameters!report.Value,","),"report1")>0,false,true)
    6.Use the expressions below to control the visibility of the ‘report2’, ‘report3’, ‘report4’, ’report5’:
     =iif(InStr(join(Parameters!report.Value,","),"report2")>0,false,true)
     =iif(InStr(join(Parameters!report.Value,","),"report3")>0,false,true)
     =iif(InStr(join(Parameters!report.Value,","),"report4")>0,false,true)
     =iif(InStr(join(Parameters!report.Value,","),"report5")>0,false,true)
    Thus can you tell me how all values from the 'report' parameter can be selected automatically  when the ssrs report is executed?

    Pass default value as below and see
    =Split("Report1,Report2,Report3,Report4,Report5",",")
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Query to get Contact person in UDF

    Dear experts,
    I am trying to create Query to get Contact person in UDF
    SELECT T0.[CntctPrsn] FROM OCRD T0 WHERE T0.[CardCode] =$[OQUT.CardCode]
    changes may be made to contact person.
    how can i link OQUT to OCRP with Contact person?
    Or any other way to get Contact person in UDF?
    Pls advise
    Thanks in advance
    jo

    HI
    Use this query:
    select t1.name from OCPR t1 on t0.CntctCode = t1.CntctCode where t1.CardCode = $[OQUT.CardCode]
    Edited by: kambadasan on Feb 20, 2012 3:22 PM

  • I was trying to get my personal computer contacts and calendar in outlook on my iphone and ipad.  I was told to use icloud.  I went to control panel and then icloud and selected my contacts and calendar.  Now ALL MY DATA IS DELETED FROM OUTLOOK.  Help!!

    I was trying to get my personal computer contacts and calendar in outlook on my iphone and ipad.  I was told to use icloud.  I went to control panel and then icloud and selected my contacts and calendar.  Now ALL MY DATA IS DELETED FROM OUTLOOK.  Help!!

    I was just on the line with Apple Tech support.  First of all, I learned that when you link contacts to iCloud, it moves all your contacts to another/new address book...look for aother address books and you will see it.  But I found the new address book dies weird things and changes the "Display Names" format.  Evidently (per Apple support tech) there is no way to avoid this problem...so I just delinked the iCloud from my contacts.  The contacts stayed in the iCloud address book...so I exported them to a CSV (comma separated value) file and saved it on my desktop and then imported that list into my original contacts folder.  Now everything is back the way it was...being able to use my contact address book the way I did before.  I was surprised that they never considered or realized this problem...but then the tech guy admitted that they really don't have A LOT of experience using Windows PC's.

  • How get all table name from database

    hi master
    sir
    how get all table name from database

    The big question is 'why'.
    Selecting from view 'dba_tables' will indeed give the list of all tables in the database, but that includes the dictionary tables and the internal tables, and many others that are probably not of interet to a person who needs to ask this question. Besides, the dba_tables view requires access to a DBA account.
    There are several other views: "user_tables" will list all the tables in this user's schema; and "all_tables" will list all the tables this user can access in some way.
    The above do not, of course, include any information about synonyms, sequences, views, indexes and so on.
    The correct answer and the meaningful answer may be two different things.

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

  • How to get all INDEXes from a database

    How to get all INDEXes in a database? I need to store them in script file (.SQL). My database version is 10.2.0.3.0.
    Edited by: Iniyavan on Sep 18, 2009 1:39 PM

    --Thanks, Koppelaars. The second query works. But I'm unable to store in spool file. May be it's due to CLOBs in the output. I did the following:
    set head off
    set feedback off
    set linesize 32727
    set pagesize 50000
    spool c:\indexes.sql
    select dbms_metadata.get_ddl('INDEX',INDEX_NAME,'MYSCHEMA')
    from user_indexes;
    spool off
    --In the spool file, I find only this
    CREATE UNIQUE INDEX "MYSCHEMA"."A" ON "MYSCHEMA"."BNK_DEALID" ("DEAL_ID")
    PCTF
    CREATE INDEX "MYSCHEMA"."ACCENT_RAC_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "VAL
    CREATE INDEX "MYSCHEMA"."ACCENT_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "APP_REF
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCENT_X" ON "MYSCHEMA"."ACCENT" ("DEAL_ID")
    P
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCNAV_X" ON "MYSCHEMA"."ACCNAV" ("SCHEME", "ACCNA
    --How to get all the DMLs in one SQL file?
    --Nagappan, I'm using WIN.

Maybe you are looking for

  • Tiger Mail Not Sending Emails

    It USED to work ... but the mail feature for Tiger is no longer sending emails (but it DOES recieve them). The Error Message is as follows: This message could not be delivered and will remain in your Outbox until it can be delivered. The connection t

  • Repeating Header Rows - Not repeating beyond page 2

    Hello, I'm at my wit's end and I have yet to see a response to questions related to repeating headers (though I've seen it in a few forums). I have a flowed form with an initial header table and then 4 subforms, each made up of tables with a header g

  • ISight on MacBook die

    I have a problem like Gabe with him iSight. After PRAM and PMU reseting, camera works few weeks and stop again. After that work just one day and stop again I think that a problem appears after new EFI firmware update and/or BootCamp Beta instalation,

  • Manual network selection for iPhone 5

    i need manual network selection for iPhone 5 why do not?

  • Exporting to .mp4 file using QuickTime Pro

    Rather than use the Movie to iPod preset in QuickTime pro, I would like to export an .avi file to a .mp4 file using Movie to MPEG-4. I would like the resulting file to be encoded using h.264 video and to be 640 X 480. I want one file that I can inclu