Expecting the output in specific manner by using sql query

Right now i am executing the query that is showing an output like this
FILTER_CATEGORY NAME
alarm     orgObjectTypeRaw
alarm     eventType
obj_alm     OSS_NAME
obj_alm     TYPE
obj_imp OOF INDICATOR
obj_imp     PORT TYPE
obj_nwk     OSS_NAME
obj_nwk     TYPE
obj_rep     OSS_NAME
obj_rep     TYPE
Here the name of the filter_category is alarm which has different names are orgObjectTypeRaw and eventType and so on..
here only one alram contain different names
i am expecting the output like this...
FILTER_CATEGORY NAME
alarm     orgObjectTypeRaw
     eventType
obj_alm     OSS_NAME
TYPE
obj_imp OOF INDICATOR
PORT TYPE
obj_nwk     OSS_NAME
TYPE
obj_rep     OSS_NAME
     TYPE
Could you please help out me

Hi,
If you are using SQL*PLUS,then before executing query,execute this command:
BREAK ON FILTER_CATEGORYIf not,then you should modify your query inorder to get row number according to FILTER_CATEGORY
and don't display the category when row number is not 1
Here is an example for you
select case when rno=1 then deptno else null end Deptno,
       ename
from
select deptno
      ,ename
      ,row_number() over (partition by deptno order by sal) rno
from
scott.emp
)Edited by: Sreekanth Munagala on Jan 6, 2009 2:30 AM

Similar Messages

  • How to retrive the blob data from a table using sql query

    Hi gurus,
    I have a table which has " BLOB "content in a column .I want to view the data From BLOB column using sql query .It would be helpfull If some one share their idea.
    Regards,
    vardhani.

    You can use data templates.
    See this: http://blogs.oracle.com/xmlpublisher/entry/blob_clob_raw_and_looooong
    http://blogs.oracle.com/xmlpublisher/entry/inserting_blobs_into_your_repo
    Thanks,
    Bipuser

  • Information about constraints by using SQL query?

    Hi
    how can we view all the definition of a constraint by using SQL query.
    Suppose I create following tables:
    CREATE TABLE supplier
    ( supplier_id numeric(10) not null,
    supplier_name varchar2(50) not null,
    contact_name varchar2(50),
    CONSTRAINT supplier_pk PRIMARY KEY (supplier_id, supplier_name)
    CREATE TABLE products
    ( product_id numeric(10) not null,
    supplier_id numeric(10) not null,
    supplier_name varchar2(50) not null,
    CONSTRAINT fk_supplier_comp
    FOREIGN KEY (supplier_id, supplier_name)
    REFERENCES supplier(supplier_id, supplier_name)
    ON DELETE CASCADE
    e.g. CONSTRAINT fk_supplier_comp: Plz write me the SQL query that tells that this is a FOREIGN KEY (supplier_id, supplier_name) and REFERENCES supplier(supplier_id, supplier_name) .....etc.
    thanks

    You mean "What is an Oracle Metalink?"
    Then, Oracle Metalink (www.metalink.oracle.com) is an official web site of Oracle Corporation. This is the area where you can get an ultimate and immediate fixes for any sort of Oracle/Issues/Problems. And also, Patches/fixes/Notes/Procedures can be used as reference and can be downloaded from this.
    Note: Sharing of Oracle Metalink information/credentials is highly illegal act.
    Fore more information and benefits on Oracle Metalink, please take a look at the below URL.
    http://www.oracle.com/support/premier/metalink.html
    Regards,
    Sabdar Syed.

  • Getting the output from a Perl script using Runtime.exec

    I cannot get the output from a perl script using Java. Can someone PLEASE help?
    I used the following code:
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    InputSream in = p.getInputStream();
    b...
    do
    System.out.println(b);
    while ((b = in.read()) > 0)
    But there is no way that I get the output in the inputstream. If I use the command "cmd script.pl", the output is displayed in the Dos box, but also not in the inputstream.
    I will appreciate any help.

    Try this
    Process p = Runtime.getRuntime().exec("C:\\Perl\\bin\\Perl.exe script.pl) ;
    BufferedReader rd = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String str;
    while((str=rd.readLine())!=null){
    System.out.println(str);
    Manu

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How do i get the approximate size of back up file required to save on disk using sql query because i want to show the required sapce for backup on my application

    hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application  

    Hi FIROZ
    TENNALI
    Is this still an issue, or can we close the thread?
    * closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How will get the source code of all the tables in a given schema using SQL?

    Hi All,
    How can we get the source code of all the tables in a given schema using SQL?
    Thanks in Adv.
    Junu

    Try something like...
    set heading off
    set pagesize 0
    col meta_data for a96 word_wrapped
    set long 100000
    SELECT DBMS_METADATA.GET_DDL(object_type, object_name, owner) ||';' AS meta_data
    FROM dba_objects
    WHERE owner = '<SCHEMA NAME>'
      AND object_type not in (<list of stuff you do not want>);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to insert the records using sql query

    hi,
    i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
    how can i solve this problem?
    Regards,
    M.Thippa Reddy

    You are not support use Insert / Update / Delete on SAP Databases directly.
    SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
    Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How to show the VALUE as the Column Header using SQL query?

    Hi
    I have a requirement to show the picked value as the column header using SQL query.
    Example:
    ======
    SELECT EMPNO FROM EMP
    WHERE EMPNO=7934;
    Result Should be:
    7934
    7934

    I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
    SQL> set verify on
    SQL> def e =  7934
    old: SELECT empno "&&e"  FROM emp  WHERE empno = &&e
    new: SELECT empno "7934"  FROM emp  WHERE empno = 7934
    SQL> SELECT empno "7934"  FROM emp  WHERE empno = 7934
          7934
          7934
    1 row selected.

  • Failing to import data using SQL query

    I am trying to import data from a sql query to analysis service in SSDT. i went to model > import from data source >Microsoft SQL Server and i chose from query. I typed my query which works fin in SSMS and when i press import if gives me a error. what
    is going on please help here is the error
    DirectQuery error: All tables used when querying in DirectQuery Mode must be from a single relational Data Source.
    here is my query:
    USE AdventureWorks2012;
    SELECT SalesPersonID, [29484] Brian, [29485] Peter, [29486] Frank, [29518] Sarah, [29519] Janet, [29520] Alice, [29608] Martin, [29609] Patrick, [29610] Wasu, [29780] Samanyika, [29781] Vladmire
    FROM
    SELECT SalesOrderID, SalesPersonID, CustomerID 
    FROM Sales.SalesOrderHeader
    WHERE SalesPersonID IS NOT NULL
    As P PIVOT
    COUNT (SalesOrderID) FOR CustomerID IN ([29484], [29485], [29486], [29518],  [29519], [29520], [29608], [29609], [29610], [29780], [29781])
    AS PVT
    ORDER BY SalesPersonID ASC;

    Hi,
    When importing data from relational data source, the steps are:
    In SQL Server Data Tools (SSDT), click the Model menu, and then click Import
    from Data Source.
    On the Connect to a Data Source page, select the type of database to connect to, and then click Next.
    Follow the steps in the Table Import Wizard. On subsequent pages, you will be able to select specific tables and views or apply filters by using the Select
    Tables and Views page or by creating a SQL query on Specify a SQL Query page.
    As we can see on the steps, we need to select one database, so we needn't to write "USE AdventureWorks2012" on the query.
    Reference:Import from a Relational Data Source
    Regards,
    Charlie Liao
    TechNet Community Support

  • Checking correct data format using sql query

    1) I got column date of joining which accepts date in below format
    DD-MON-YYYY
    DD-MON-YY
    MON-DD-YYYY
    MON-DD-YY
    Month DD,YYYY
    Question:- how do i check whether all dates in Date of joining column are in above format or not using sql query?
    2) I got one more date column which accepts date in below format
    MMDDYYYY
    YYYYMMDD
    MM/DD/YYYY
    MM/DD/YY
    YYYY/DD/MM
    Question:- how do i check whether all dates in date column are in above format or not using sql query?
    sorry if it is a very simple question since I am new to sql and trying to learn ......Thanks for the answers from the group............

    In short, NO, it's not possible.  If you store dates correctly in the database as DATE datatype then you don't have this problem.  If you store them as VARCHAR2 you have a problem.
    So, you get a date of 20092012
    Is that 20th September 2012?  or is it 20th December 2009?
    What about...
    11-Jan-12
    Is that 11th January 2012 or 12th January 2011?
    Dates should never be stored on the database as strings.  That is why Oracle gives you a DATE datatype so you can store them properly.
    Also, when dates are passed from an application to the database, the application should be passing them as DATE datatype, and the application interface should be designed to accept dates from the user in a format specific to their country/locality and it would then know what that format is and automatically convert it to a DATE datatype before it gets anywhere near the database or any SQL.

  • Dataload using sql query

    Hi,
    i need to load the data using sql query in to essbase cube by using maxl .If any one knows this please let me know.
    i
    thanks in advance

    Here is a sample maxl script I use to clear, load, and calculation a BSO Application and Database. Both the Application and Database are titled "STAT_2".
    /*** Login to essbase server ***/
    /*** login $1 $2 on $3; ***/
    login 'username 'password' on 'server';
    /*** Set output file to spool all error messages only ***/
    spool stdout on to 'C:\Hyperion\Automation\Logs\STAT_2_ALL_Load_Essbase.LOG';
    spool stderr on to 'C:\Hyperion\Automation\Errors\STAT_2_ALL_Load_Essbase.ERR';
    /*** Clear data in STAT_2 ***/
    /** execute calculation 'STAT_2'.'STAT_2'.'ClrA2Yr'; **/
    /*** Import data from the FACT_STAT_2YEARS table using a load rule ***/
    import database 'STAT_2'.'STAT_2' data connect as 'SQLUserName' identified by 'SQLPassword' using server rules_file 'LdA_All.rul' on error write to 'C:\Hyperion\Automation\Logs\STAT_2_ALL_Load_Essbase.log';
    /*** Calculate data in STAT_2 ***/
    /** execute calculation 'STAT_2'.'STAT_2'.'ClcA2Yr'; ***/
    spool off;
    logout;
    exit;

  • Retreving Hexadecimal Values from a table using SQL query.

    Hi,
    I'm looking for a query to retreive Hexadecimal values contained in a column using SQL query.
    The column contains the values of all types, alphanumeric, numeric and hexadecimal.
    I need to retreive only hexadecimal values.
    any help to me in this regard will be appreciated.
    Thanks

    Presumably, you can be sure that any valid hex value is indeed MEANT to BE a hex value. For example the value 'ACE' is meant to be a hexadecimal value and not the word.

  • How to get tax break up of TDS using SQL query ?

    Hi all,
    We are developing a TDS report using SQL query
    Report will contain VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount,
    Bill Value – 100.000,
    TDS (2%) - 2.000,
    TDS Surcharge(10% on TDS) - 0.2,
    TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
    TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
    We have developed this report which displays upto
    VendorCode,Date(ap inv date),Vendor name,
    Bill value,TDS Amount.
    How to show tax break up of TDS in SQL query ?
    Thanks,
    With regards,
    Jeyakanthan.

    Hi gauraw,
    Thank for your reply.
    I modified the query , pasted the query
    as below in query generator,
    Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
    (((TDSAmt0.1) + TDSAmt)0.02)  as 'TDSCess',
    (((TDSAmt0.1) + TDSAmt)0.01)  as 'TDSHCess'
    FROM OPCH T0  INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
    WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
    on clicking execute its showing error message invalid column
    name 'TDSAmt'.
    With regards,
    Jeyakanthan

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

Maybe you are looking for

  • Need to turn off the iCloud services

    I no longer have the iPhone 4s. Now I cannot receive text messages from other iPhone users on my new cell phone. I need to turn off iMessage.

  • Upgrade From 10.1.2 to Tiger

    I have a friend who was using her flat panel iMac mainly in OS9. She wanted to upgrade to Tiger and has been sold the OS but is now worrying that she will have to wipe her entire hard drive to install it. She doesn't want to do this. Will the discs p

  • Number of Child Members in a Parent

    Hi There, Is there a way in BPC in when building a report or input schedule in which I can return the number of child members that is below a parent? I want to select a member in my dimension and I want a formula to return how many members is below t

  • Pls tell me how to check the errors in  BDC CALL TRANSACTION

    lemme know

  • Mass Closing Of PR

    Hi All, Please let me know any std., T.code will be available to close all open PR in MASS. I tried with MEMASSRQ but it is providing option in first I/P screen, when we go and enter to next screen where we will change anything in MASS this option of