SQL data extraction?

Hi,
can nay one here tell me what is SQL data extraction?
in one on my requirements it was written simply SQL data extraction as flat file
then modelling the data flow for the falt file to the BW.
is it something related to database?
explain me
Thanks,
Ravi

Hi,
it means that your flat file will be generated out of an database by SQL means (SQL = Structured Query Language).
For instance your flat file will have the data returned by a statement like:
SELECT FIELD1, FIELD2, FIELD3 FROM TABLE.
The above is SQL but it can definitively be more complex (several tables, filters, grouping/aggregation...)
Your flat file will then be loaded in your BW.
Hope this helps...
Olivier.

Similar Messages

  • Data extraction with PL/SQL

    Hi Expert
    My customer wants to use PL/SQL language for SAP data extraction in Oracle database. He doesn’t want to use ABAP code for this.
    In my opinion I think that it’s not correct to do this but I have no solid argument.
    Could anyone explain to me why it’s not advisable to use the ORACLE  database directly for this data extraction?
    Best regards

    Hi,
    PL SQL(Native SQL) statements bypass the R/3 database interface. There is no table logging, and no synchronization with the database buffer on the application server. For this reason, you should, wherever possible, use Open SQL(ABAP SQL) to change database tables declared in the ABAP Dictionary. In particular, tables declared in the ABAP Dictionary that contain long columns with the types LCHR or LRAW should only be addressed using Open SQL, since the columns contain extra, database-specific length information for the column. Native SQL does not take this information into account, and may therefore produce incorrect results. Furthermore, Native SQL does not support automatic client handling. Instead, you must treat client fields like any other.
    I think this will be useful for you

  • Extracting data from ms sql data base

    Hi Experts,
    we have a requirement of extracting data from MS SQL data base,could any one pls help me with the approach to extract data
    from ms sql data base(actually we have to extract the data from PRIMAVERA i.e the back end data base is MS SQL data base and the application is built on java)so we have got two options one is using ud connect and the other one is using PI(XI).i came to know the two approach have based on differenct methods,pull and push mechanism.and also for PI,it can be extracted using
    real time data acquisition property in dtp and for db connect it don't support real time data acqusition.
    so pls guide me,which mechanism would be feasible to extract the data from PRIMAVERA to SAP BI.and can you suggest with methods is more efficient.
    Thanks in advance.

    Hi thanks for the reply,
    initially we tried with db connect,but our Bi system(oracle) is mount on unix OS and the Primavera(MS Sql DB)is on windows OS.so we could not found the data base shared library  once if the DB client is installed on the application server.so we are working around with the other possibilities,so can you suggest me which could be favarable in our case.
    Thank You.

  • Simple data extraction reports by SAPu2019s SQL

    Hi,
    Can you please let me know how can I develop simple data extraction report using SAP's sql.
    Regards,
    Koushik

    HI,
    I have to do a PoC on Data Quality checks. In which there will be few reporting tables. One will be daily agreegate, one weely agreegate etc. Now I have to show those the data in form of reports. and Option is also required to drill down and drill up for those reports.
    Please let me know if I am able to clarify my question or not.
    Regards,
    Koushik

  • Pl/sql to extract data  with form: extract data is a text file

    Hi dear all,
    to be straightforward here is the problem: we currenlty developing with oracle tools :" Developer Suite 10g version 10.1.2.0.2" an interface .
    Using oracle forms, we would like to program a command button that will be in charge of pooling the data from the database and offer the client to save it on his desktop. The extracted data should be a one single flat text file having a one single continuous row. and the data extracted are from a 10 g database( one table having one column(varchar2(240); and 192 rows );
    attached with this mail is ou current script link with the command " when-button-pressed"
    PROCEDURE EXTRACTION_FICHIER_FIC_BDF IS
    n_bouton number;
    LF$File CLIENT_TEXT_IO.FILE_TYPE;
    LC$Name Varchar2(100) ;
    LC$Fic Varchar2(100) ;
    LN$Lines Pls_integer := 0 ;
    LC$Line Varchar2(4000) ;
    -- cursor --
    Cursor C_CUR Is
    SELECT ENREGISTREMENT_BDF
    FROM ops$admO7.fic_bdf
    ORDER BY 1;
    BEGIN
    LC$Name := 'd:\AA1217.bdf';
    LC$Fic := WEBUTIL_FILE.FILE_SAVE_DIALOG
    'd:\',
    LC$Name,
    'Choisir l''emplacement du fichier à sauvegarder'
    If LC$Fic is null Then
    Return ;
    End if ;
    -- Open the file --
    Begin
    LF$File := CLIENT_TEXT_IO.FOPEN( LC$Fic, 'W');
    Exception
    when others then
    message( 'OPEN FILE ERROR ' || LC$Fic );
    raise form_trigger_failure;
    End ;
    -- Write the lines --
    For Cur In C_CUR Loop
    LC$Line := Cur.ENREGISTREMENT_BDF;
    CLIENT_TEXT_IO.PUT_LINE( LF$File, LC$Line ) ;
    LN$Lines := C_CUR%ROWCOUNT ;
    End loop ;
    -- Close the file --
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
    set_alert_property('AL_MESSAGE',alert_message_text,'Export terminé avec succès');
    n_bouton :=show_alert('AL_MESSAGE');
    synchronize ;
    Exception
    When form_trigger_failure Then
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
    Raise ;
    END;
    thanks if advance !!!!!

    Hello,
    what's your problem with this? You posted a lot of useful information like version infos and code (Hint: when you post code you can do this with the tags so it gets formated), but I cannot see what exactly is failing or behaving unexpected, so you might share that too ;)
    cheers                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Put java.sql.Date in correct format

    I need to put java.sql.Date in correct format to query an Oracle database.
    Here is my code:
            SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
            java.util.Date dateChosen = jXDatePicker1.getDate();
            String strDate = formatter.format(dateChosen);
            System.out.println("Date Chosen: " + strDate); // output is: 11-Feb-00
            java.util.Date parserDate = null;      
            try {
                parserDate = formatter.parse(strDate);
            } catch (ParseException re) {
                System.err.println("Exception caught: " + re.getMessage());
            // create java.sql.Date object
                java.sql.Date oraDate = new java.sql.Date(parserDate.getTime());
            System.out.println(oraDate);  // date is in this format: 2000-02-11
            System.out.println("formatted oraDate: " + formatter.format( oraDate ) ); // no good, stringIf I use formatter.format( oraDate ) I get the correct format (11-Feb-00) BUT it is no longer a sql Date, it is a String which can't be use.
    I have looked at the API and many other forum threads on this, any help would be greatly appreciated!

    In the class with the PreparedStatement, I pass the date like this:
    public class report extends javax.swing.JDialog {
         java.sql.Date newDate;
        public report(java.sql.Date passedOraDate, String passedtxtDate) {
            super();
            initComponents();
            setTitle("Report");
            setModal(true);
            newDate = passedOraDate;
            statusLabel.setText(passedtxtDate);
            System.out.println("passedtxtDate: " +passedtxtDate);       
            System.out.println("newDate: " +newDate);      
        }Here is the code that uses the actual PreparedStatement:
            try {
                // In my actual code I have all columns listed in query
                String query = "SELECT * FROM report WHERE repdate = ?";
                ps = conn.prepareStatement(query); // create a statement
                           ps.setDate(1, newDate); // set input parameter
                rs = ps.executeQuery();
                // extract data from the ResultSet
                ResultSetMetaData md = rs.getMetaData();
                int columns = md.getColumnCount();This is greatly edited to show relevant code!

  • Data Extraction from Informatica

    Hi BI Gurus,
    I want to extract the data from SQL server through informatica. I went through SDN, but  I am not able to found relevant information. Please share the steps (methods) or links or documents about data extraction from informatica.
    Regards,
    PRK

    Hi,
    Use UD connect procedure to extract the data from Informatica or SQL server. you just need to create a new source system with the parrameters that can connect and read the SQL sever.
    There is another way of extracting it through DB connect as well, but I recommend you to go through the UD connect procedure to extract the data.
    Check with your basis team to setup a source system for SQL server if you are not aware of how to as it is purely based on TCP/IP.
    you need to create a source system as trird pary and supply the parrameters to it. Create a TCP/IP connection in SM59 to that source system where it need por numbers, schemas, alias etc to connect to the SQL server.
    Browse for UD connect in WIKI, will guide you good docs.

  • Data extraction from Oracle database

    Hello all,
    I have to extract data from legacy database tables. I need to apply a lot of conditions on data extraction using SQL statements for getting only valid master data, transaction data, SAP date format etc. Unfortunately I don;t have a luxary of accessing legacy system data base table to create table views and applying select statements.
    Is there anyother way round by which I can filter data on source system side w/o getting into legacy system. I mean being in BW data source side.
    I am suppose to use both UD connect and DB connect to test which will workout better way of data extraction. But my question above should be same in either interface.
    This is very urgent as we are in design phase.
    Points will be rewarded immediately.
    Thanks
    Message was edited by:
            Shail
    Message was edited by:
            Shail

    Well I and eveyone know that it can be done in BI.
    I apologize that I did not mention it in my question.
    I am looking for very specific answer, if there is any trick we can do on source system side from BI. Or where we can insert SQL statements in infopackage or data source.
    Thanks

  • SQL function extract

    Hello XML Guru,
    Could you tell me where i can find informations about how SQL function extract works for extracting XML data stored as relational-object?
    Is VIEW always created for extracting XML data when executing this SQL function extract?
    Thanks for your help.

    You'll find documentation on this function in the [Oracle XML DB Developer's Guide| http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb03usg.htm#sthref336] .
    HTH
    Chris

  • Data Extraction is Stuck

    Hi. We have a process extracting data from an Oracle database via JDBC connection. In general, the process takes more than 4 hours to extract 7-8 millions rows of data into a flat file. At the first 2-3 hours, the entire process is totally idle, and total rows were 32k. During that period of time, the temp tablespace is fine; the session is still active, but CPU is idle. Does anyone have any clues the root cause of data extraction is stuck?
    Thanks.

    >
    Hi. We have a process extracting data from an Oracle database via JDBC connection. In general, the process takes more than 4 hours to extract 7-8 millions rows of data into a flat file.
    >
    Then your process is doing something terribly wrong. But since you didn't post any information about whay your process is doing or the Java code that is doing it there isn't any way to help you.
    This thread should be reposted in the JDBC forum
    https://forums.oracle.com/forums/category.jspa?categoryID=288
    When you post provide your 4 digit Oracle version, full Java version, JDBC jar file name and version and the Java code that is doing the extract.
    Make sure you post the code that shows the query being executed, the batch settings that are made and how the data from the result set is being processed and written to the file.
    >
    At the first 2-3 hours, the entire process is totally idle, and total rows were 32k. During that period of time, the temp tablespace is fine; the session is still active, but CPU is idle. Does anyone have any clues the root cause of data extraction is stuck?
    >
    Since 32k rows can be extracted and written in a matter of seconds those metrics should convince you that you have a serious problem with your methodology.
    You need to do some basic troubleshooting to see if the problem is in the DB, the network, or writing the data to the file system.
    1. Run your query manually using a tool like sql developer or Toad to see how long it takes to return the first 50/500 rows in the result.
    2. Modify your app to quit after executing the query to see how long it takes to return from the EXECUTE statement.
    3. Modify your app to do nothing at all with the result set (do NOT write it or access it at all) except iterate it using ResultSet.next(). How long does that take?
    4. Stop working with millions of rows until your app actually works properly. That indicates that you did not do any testing or you would have known there was a problem before now.

  • ECC Data extraction

    Hello All,
    I have a situation in my department where I need to extract the ECC data to third party database (MS SQL). Initially we were thinking of using SAP BW extractors for extraction through SAP PI to push the data out but this doesn't seem to be feasible. Is this a fair assessment of the situation?
    What other methods we can use for data extraction? We are evaluating options for ABAP programs, SAP Queries and BAPIs. Is there any other way we can extract this data set. The data set is required for sd,fi-ar/ap,mm,pp.
    We donot need data fro real time time basis, but on the same lines of a data warehouse extraction like SAP BW.
    Appreciate your help.
    Thanks

    Hi
    I recently figured out what to do and here is what we do :
    Not many would like to allow you to extract data directly from SAP R/3. But we have been successful in extracting data for our in-house implementation of BI at ORG level. You need to understand which tables of R/3 would give you what information.
    If that information could be gathered. Then extracting data on BODS is very simple. Though it is a bit tricky and it is not direct. But a we do it as a process of different stages.
    We use BODS 3.1
    Step 1 :
    You need to create 2 connections on SAP R/3 Datastore :
    1) conn 1 :
    Use the option generate and execute - ABAP Execution option
    data transfer mtd : direct download
    working directory on SAP Sever : here give local path on which BODS server is running e.g. ; d:\bods
    local directory : : d:\bods
    Generated ABAP directory : d:\bods.
    execute in bg : no
    Create data flow :
    SAPR/3 >>> (sap r/3 table>>>query transformation>>data transport (dat file))
    ||__query transformation >> target database (we have chosen oracle) . You could create a datastore for sql server.
    And Import that table table under this connection.
    Even for SAP R/3. Import that table immediately after you create the SAP R/3 datastore.
    We have used the option of replace file in data transport option in dat file
    So that each time you run the job the file gets replaced.
    Step 2 :
    Create a job for this work flow
    Run the job.
    It will create a dat file and a ABAP File on the specified D: Bods   folder.
    Step 3 :
    Send the ABAP File : to sap bw / sap team - requesting them to create this ABAP program. and make it available on your SAP R/3 System.
    (We found this is easy to do for anyone, all that you need is to copy paste and activiate and do the transport to the sap r/3 system and does not require any time to do any ABAP programming - as such)
    Note : For the data store creations of SAP R/3 : THE user name being used. Need to have access to all the required tables of SAP R/3. Otherwise data access will not happen. You can chek the data flow at each stage and it will say, not authorised. If you dont have access.
    Step 4 :
    Now create another SAP R/3 Connection conn2 ;
    This connection will use the option : execute preloaded (abab execution option)
    execute in bg : no
    data transfer method : shared directory
    working directory on sap server :  d:\bi_share
    (Create a shared folder on sap r/3 server : :\BI_SHARE (the user on data store should have complete access of read and write on this shared folder)
    application path to share directory :
    sapservername
    bi_share
    Step  5 :
    Now if you have the ABAP Prog already available on your R/3 system.
    Re-run the job finally using the new data store for execute - preloaded.
    which is pointing to the shared directory of sap server itself.
    And this job can be scheduled on production BODS server finally.
    ======================================================
    Wherever required, import the tables under the related data store.
    Although it might sound a lengthy process. Actually, it hardly takes a very little time, compared to the time involved in trying to ask someone on ABAP to code / or take help of BW or whatever.
    We have done things on DEV BODS tested the same.
    then we have moved everything into production.
    And till date : it has been successful for us.
    We have taken help of ABAP programers only when we explicity required some customised logical programming. Which was not available directly on SAP R/3 system. 
    Otherwise if we generally pull all the fields once we take any table from SAP R/3 so that i could be used any time later. Even if not required today.
    And SO with a little effort, even a person who is new to SAP R/3  or BW or BODS.... like me, is able to manage. So, it is not difficult i suppose.
    Good Luck.
    We have used oracle for reporting database. And sql server should also work the same way.
    We use sql server only for meta data information.
    like BO Repository or BODS repository
    Cheers
    Indu
    Edited by: Indumathy Narayanan on Jul 27, 2011 8:23 AM
    Edited by: Indumathy Narayanan on Jul 27, 2011 8:24 AM
    Edited by: Indumathy Narayanan on Jul 27, 2011 8:27 AM

  • Data Extract Design

    Hi All,
    I have a requirement where I have to extract data from various different tables-->Only particular columns.
    The requirements are same for different databases, hence I thought to have a single generic approach and reuse the same code to perform the extract and create an ascii file.
    Below is the typical scenarion i want to achieve, hence need your expertise inputs to start off..
    a) Define the required columns -- This should be configurable, i.e., add or remove columns in future.
    b) Extract the column names from the database for those that are defined in the step a) above.
    c) Extract the data from relevent tables/columns for various conditions based on step a and b above.
    d) Create an ascii file for all the data extracted.
    I'm unsure if there is anything wrong or please suggest the best approach.
    Regs,
    R

    user10177353 wrote:
    I'm unsure if there is anything wrong or please suggest the best approach.
    The first thing to bear in mind is that developing a generic, dynamic solution is considerably more more complicated than writing a set of extract statements. So you need to be sure that the effort you're about to expend willl save you more time than writing a script and copying/editing it for subsequent re-use.
    You'll probably need three tables:
    1. Extracts - one record per extract definition (perhaps including info such as target file name)
    2. Extract tables - tableges for each extract
    3. Extract columns - columns for each extracted column.
    I'm writing this as though you'll be extracting more than one table per run.
    The writing to file is the trickiest bit. Choose a good target. Remember that although we called them CSV files, commas actually make a remarkably poor choice of separator, as way too much data contains them. Go for soemthing really unlikely, ideally a multi-character separator like ||¬.
    Also remember text files only take strings, so you need to convert your data to text. Use the data dictionary ALL_TAB_COLUMNS view to get the metatdata for the extracted columns, and apply explicit masks to date and numeric columns. You may want to allow date columns to have masks which include or exclude the time element.
    Consider what you want to do with complex data types (LOBs, UDTs, etc).
    Finally, you need to address the problem of the extract file's location. PL/SQL has a lot of utilities to wrangle files but they only work on the server side. So if you want to write to a local drive you'll need to use SPOOL.
    One last thought: how will you import the data? It would probably be a good idea to use this mechanism to generate DDL for a matching external table.
    Cheers, APC
    Edited by: APC on May 4, 2012 1:08 PM

  • Data Extract - Partitioning

    Hello,
    I have a table containing 3 columns Department Name, RiskScenario and Cost. I am trying to create a data extract that contains the top 3 Risk Scenarios (sorted by Cost) per Department.
    I tried using this sql statement in MSQuery but it doesn't work. Any ideas where I'm going wrong or if there is a simpler way to do this?
    Select * from (
    Select DepartmentName, `Risk Scenario`, Cost, row_number() OVER (PARTITION BY DepartmentName order by Cost) rn
    FROM 'Departmental Risks`) where rn <=3
    Please help. Just can't figure this out!
    Meera 

    Meera:
    I mocked the data with this table:
    create table [Departmental Risks]
       (    DepartmentName      varchar(30),
            [Risk Scenario]     varchar(30),
            cost                numeric (9,2)
    go
    insert into [Departmental Risks] values ('Dept A', 'Scene 1', 45.32)
    insert into [Departmental Risks] values ('Dept A', 'Scene 2', 29.95)
    insert into [Departmental Risks] values ('Dept A', 'Scene 3', 71.45)
    insert into [Departmental Risks] values ('Dept A', 'Scene 4', 54.34)
    insert into [Departmental Risks] values ('Dept B', 'Scene A', 21.45)
    I then ran tried this query and obtained the result that follows:
    select DepartmentName,
           [Risk Scenario],
           cost
    from ( select DepartmentName,
                  row_number () over
                  ( partition by DepartmentName
                    order by cost desc, [Risk Scenario]
                  ) as Seq,
                  [Risk Scenario],
                  cost
             from [Departmental Risks]
         ) a
    where seq <= 3
    order by DepartmentName,
             cost desc,
             [Risk Scenario]
    -- --------  Output:  --------
    --   DepartmentName  Risk Scenario   cost
    --   Dept A          Scene 3         71.45
    --   Dept A          Scene 4         54.34
    --   Dept A          Scene 1         45.32
    --   Dept B          Scene A         21.45
    See if this is in the direction you are aiming.
    Dave

  • Data Extract Programme

    Hi,
    I need help from you in the Data Extract from AR Aging Tables into a CustomTable and the data from the custom table is loaded into Access and it's migrated into SAP.
    I am a new for this requirement.Please let me know how can i proceed?,How many programmes should be written for Data Extract from AR into Custom Table and from Custom table into Access Please let me know the Custom Table creation I am a new person for the MD070 Document.,
    Please help on this regard

    The Oracle XML SQL Utility may be used to store & retreive an XML document in a database.
    http://www.oreillynet.com/pub/d/338

  • Position Activity Sequence Resulting in data extracting error

    hi gurus
    can any body tell me what is this position activity sequence error resulting in data extracting error, plz help. this is very high priority for me.
    regards
    dev

    I rebuild the report using a tabular form and populated the primary key with a PL/SQL expression and now it appears to be working. P1_ISSUE_NO is the primary key on the issue table and I could not figure how to get it in the issue_no field of the tabular report when a new line was entered I ended up putting the following code in for the default for
    issue_no on the report:
    Begin
    return :P1_ISSUE_NO;
    end
    It works great.

Maybe you are looking for