Retrieving Data from SQL Server Database

Hi All,
I am working with a program in which i have a requirement to connect to SQL Server Database
and extract the data from the SQL Server Database. I am able to connect to the SQL Database but i am facing problem with the Select Statement. I have the Select Statement
Select PARTNRID from GBA_SI.TRACKING and REFERENCEID3 from HEADER where TRANSTYPE = "INVOIC" and WICOMPLETEDDATETIME is within the date range specified in selection screen (Join on TRANSID).
Can any one tell me how to write the Select Statement in ABAP for retrieving the data from the SQL Server Database.
Regards,
Sudhir

hi check this..
data: begin of itab occurs 0,
       PARTNRID  like GBA_SI-PARTNRID,
      end of itab .
data: begin of itab1 occurs 0,
        TRANSID like header-TRANSID,
        TRANSTYPE like header-TRANSTYPE ,
        REFERENCEID3 like header-REFERENCEID3,
        end of itab1 .
select-options:s_PARTNRID for GBA_SI-PARTNRID ,
                     s_date for sy-datum.
Select PARTNRID
    from GBA_SI
         into table itab
where PARTNRID in s_PARTNRID.
select TRANSID
         TRANSTYPE
  REFERENCEID3 from HEADER
into table itab1
for all entries in itab
where TRANSID = itab-PARTNRID
     and TRANSTYPE = "INVOIC"
and WICOMPLETEDDATETIME  in s_date .
regards,
venkat appikonda

Similar Messages

  • Exporting data from SQL Server database to Oracle database

    Hello All,
    We need to replicate a table's data of SQL Server database to Oracle database.
    Can this task be accomplished using Import/Export wizard or Linked servers?
    Can help me regarding which Oracle data access components should i download to do this?
    I am using SQL Server 2012.
    And i have Oracle 11g release 2 client installed in my system.
    Thanks in Advance.
    Thanks and Regards, Readers please vote for my posts if the questions i asked are helpful.

    Yes you can definitely transfer data from SQL server to Oracle Have a look at below links
    Export SQL server data to Oracle Using SSIS
    Use OLEDB data provider to transfer data from SQL server to Oracle
    Using Import Export Wizard
    Similar thread
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Connect & transfer data from SQL Server Database

    Hi all,
    I would like to connect to MS SQL Server Database and transfer data from the data stored in the SQL Server Database tables into Oracle Tables.
    How should I go about doing this ?
    P.S.: I am using Oracle 11g and SQL Server 2005
    Message was edited by:
    Monk

    What operating system is your Oracle database running on?
    If you're running Oracle on Windows, you can use Heterogeneous Services and Generic Connectivity along with the Microsoft SQL Server ODBC driver to create a database link from Oracle to SQL Server. If you're running Oracle on something other than Windows, you can do the same thing, but you would generally need to license either a third party ODBC driver or one of the Oracle Transparent Gateway products.
    Justin

  • How to retrieve data from SQL server?

    I'm thinking this is a request for plug-ins as I'm not aware that Indesign CS3 can hook into a SQL server.
    Specifically, I'm trying to connect to a data server which has a built-in "SQL Stored Procedure" which will give me access to this database? I'm trying to avoid dumping into a intermediate data file, like Excel or XML.
    What pointers should I try to look into? thanx, sam

    I would say it depends on what you need to do. There are a few good plugins for InDesign out there that can hook up to a database, easycatalog by 65 bit http://www.65bit.com and Cacidi http://www.cacidi.com are some of the high end plugins that I can recommend, but the question is if cost outweights  need. Both in their full version are quite costly.
    If you can give a better description of what you need to do it might be easier to recommend a solution.

  • Read image data from SQL Server database and display it in a JSP web page

    Hi experts,
    I am doing a project in which I have to upload images to the database via JSP/servlets. I am able to do this.
    Now I want users to view and dowload these images which are stored in the database.
    Please help me of how can I read the images from the database and display it on jsp webpage and also can be downloaded by users via jsp pages on client side.
    Please help!

    Hi you may go through the below post to find what could be a better way to do that.
    http://forum.java.sun.com/thread.jspa?threadID=5163829
    REGARDS,
    RaHuL

  • ClickOnce WinForms Application to retrieve data from an Oracle Database

    I am hoping someone can help us.
    We are trying to create a ClickOnce WinForms Application that will allow our Customer Service group to retrieve data from an Oracle Database.
    We are currently able to use such a ClickOnce WinForms Application to allow our Customer Service group to retrieve data from SQL Server 2000 databases and even to a PICK Basic database. We use ole db drivers for these connections and keep the connection strings in a configuration file.
    Our primary question now is:
    1) What files would be needed on each client machine?
    Thanks for any pointers.
    :) Anne

    The problem has been fixed.
    If you wanna to load data from Oracle DB,the connect String should be like this:
    cnss.open "Provider=OraOLEDB.Oracle.1;data source=orcl;User Id=fdmitf;Password=fdmitf"
    besides, you should assign a value (True/False) to your function, as TonyScalese said in this post:
    Import from RDB Fails with "Error:Import failed.Invalid data or Empty..."
    Problem solved is always a great joy! Thanks!

  • Error while reversing data from SQL Server to ODI

    hi,
    I was reversing data from SQL Server Java 1.6_022 in ODI Java 1.5, I was getting error Version Mismatch and I updated ODI Java version to 1.6_022.
    And now, I am getting the below error while reversing the data from SQL Server database.
    0 : 08001 : java.sql.SQLException: No suitable driver
    Looking for the assistance on the same.
    Thanks,
    Abhay

    If everything is fine the reversing should be fine. I would say check again if the Technology of the Model and the also the dataserver is created under the right Technology in topology too.
    also if this doesn't help , Please tell us the steps you have carried so far . Also can you try selective reverse is it showing the tables.

  • How to select data from Sql server 2005 database tableinto oracle database table

    Hi,
    I have table text1 in sql server database and text2 in oracle database (11g). Now how to move data from SQL Server table into oracle table. So please help me how to do it.
    Thanks a lot in advance.
    rk
    OS: Windows 7 professional

    Hi,
    you can use export/import wizard and specify sql server as a source and oracle as destination.
    I hope this is helpful.
    Please Mark it as Answered if it answered your question
    OR mark it as Helpful if it help you to solve your problem
    Elmozamil Elamir Hamid
    MCSE Data Platform
    MCITP: SQL Server 2008 Administration/Development
    MCSA SQL Server 2012
    MCTS: SQL Server Administration/Development
    MyBlog

  • Loading data from SQL server to Oracle database

    i want to create one table in oracle db from table in sql server. Table is huge it got 97,456,789 records.
    I created db link (HS) in oracle database which is pointing to sql server. i can select that table from oracle thru db link.
    select * from "dbo"."t1@dblink;
    i fired below create table.
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...
    is there any alternate method to do this and and populate table in oracle db faster.
    Please advise. thanks.

    vhiware wrote:
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...I doubt that parallel processing will be used as this is unique to Oracle (using rowid ranges typically) and not SQL-Server.
    is there any alternate method to do this and and populate table in oracle db faster.Part of the performance overhead is pulling that data from SQL-Server to Oracle across the network link between them. This can be sped up by compressing the data first - and then transferring that across the network.
    For example: using +bcp+ to export the data on the SQL-Server box to a CSV file, compress/zip the file, scp/sftp the file to Oracle, and then unzipping it there. Parallel and direct load processing can now be done using SQL*Loader to load the CSV into Oracle.
    If this is a Linux/Unix base system, then the unzip/decompress process can be run in parallel with the SQL*Loader process by creating a pipe between the two - where the unzip process writes uncompressed data into the pipe and SQL*Loader reads and loads data as it becomes available via the pipe.
    Alternatively, you can do you own PQ processing. Let's say the data is date ranged. You can create a procedure on Oracle that looks something like this:
    {code}
    create or replace procedure CopyDay( day date ) is
    begin
    insert /*+ append */ into local_tab select * from remote_tab@remotedb where col_day = day;
    -- add logging info, commit, etc.
    end;
    {code}
    You can now start 10 or more of these for different days and run it in the background using DBMS_JOB.

  • Show data from sql server to oracle db

    Hi,
    I am using oracle 10g R1 on windows 2003 platform. On one machine database 10gR1 is running and on other machine sql server is running. I want to retrieve some data from sql server to oracle database. Please tell me how I can show data from sql server to oracle db.
    Thanks

    To make heterogeneous connection with oracle:
    1.First make an ODBC connection, make entry in System DSN(to create a data source)
    2.Make an entry in tnsnames.ora
    3.Make an entry in listener.ora under SID_LIST_LISTENER
    4.Make an entry in file named init<HS>.ora file located "oracle_base\oracle_home\db\hs\admin"
    5.Restart the listener
    e.g:
    1. create a odbc system dsn named like 'sqlserver'
    2. sqlserver= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp) (HOST=xx.xx.xx.xx) (PORT=1521))
    (CONNECT_DATA = (SERVICE_NAME=sqlserver))
    (HS = OK)
    3. (SID_DESC = (SID_NAME = sqlserver) (ORACLE_HOME = oracle_base\oracle_home\db) (PROGRAM = hsodbc) )
    4.Create a file named initsqlserver.ora and make the following entry:
    HS_FDS_CONNECT_INFO = sqlserver
    Alternatively, you can copy the file named inithsodbc.ora and rename it to initsqlserver.ora
    and edit as HS_FDS_CONNECT_INFO = sqlserver
    5. lsnrctl reload listener_name
    regards
    adnan kaysar

  • Error while retrieving data from sql using jdbc adapter

    hi all,
    i m working on one scenario where i m sending data using HTTP and receiver is jdbc adapter which is retrieving me data from sql server.
    i have checked the structure both for req and res.
    i m getting this error
    <SAP:Error>
    <SAP:Category>Application</SAP:Category>
    <SAP:Code>MAPPING.EXCEPTION_DURING_EXECUTE</SAP:Code>
    <SAP:P1>com/sap/xi/tf/_INF57285_DB_HR_RES_</SAP:P1>
    <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
    <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
    <SAP:Stack>During the application mapping com/sap/xi/tf/_INF57285_DB_HR_RES_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
    </SAP:Error>
    can somebody help me with this.
    Thanks & Regards
    Aruna

    thnks bhavesh i think i made it that way
    JDBC REQ  
      <ns:INF57285_DB_Request xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <Employee>
        <EmpDetails action="SELECT">
          <table>EmpDetails</table>
          <access>
            <Name />
            <EmpId />
            <Band />
            <Salary />
          </access>
          <Key>
            <EmpId>57285</EmpId>
          </Key>
        </EmpDetails>
      </Employee>
    </ns:INF57285_DB_Request>                        
      JDBC RES
    <ns:INF57285_DB_Request_response xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <Employee_response>
        <row>
          <Name>aruna</Name>
          <EmpId>57285</EmpId>
          <Band>A</Band>
          <Salary>4675776</Salary>
        </row>
      </Employee_response>
    </ns:INF57285_DB_Request_response>
    my hr req is which i mapped with DB req
    <ns:INF57285_HR_Req xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <REQUEST>
        <EmpNo>57285</EmpNo>
      </REQUEST>
    </ns:INF57285_HR_Req>
    my hr res is which i mapped with DB res
    <ns:INF57285_HR_Res xmlns:ns="http://www.infosys.com/xi/training/hyd/57285">
      <response>
        <row>
          <Name>aruna</Name>
          <Empld>57285</Empld>
          <Salary>4675776</Salary>
        </row>
      </response>
    </ns:INF57285_HR_Res>
    and interestingly i am not getting any error in sxmb_moni
    it's not showing any error
    plz suggest me something wht to do ....
    thnks & regards
    Aruna

  • Error while exporting data from sql server to excel

    Hi,
    I am trying to export data from sql server to excel.
    The query that I used is s follows
    INSERT INTO OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Folder1\abc.xls','select * from [Sheet1$A1:IV65000]')
    select 
    column1,column2.... from Table1
    I get the following error message while doing so..
    String or binary data would be truncated.
    The statement has been terminated.
    One of the column's holds data more than 225 characters.
    What is the way to correct this, i want the whole data of the colum in the excel sheet.

    I haven't had great luck with the INSERT INTO OPENROWSET method.  Can you try one of the many samples from one of these 3 links?
    http://www.excel-sql-server.com/excel-sql-server-import-export-using-vba.htm#Excel%20Data%20Export%20to%20SQL%20Server%20Test%20Code 
    http://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/
    https://www.simple-talk.com/sql/database-administration/getting-data-between-excel-and-sql-server-using-odbc--/
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Extract the data from SQL Server and Import into Oracle

    Hi,
    I would like to run a daily job that will export the table data from SQL server table (it will be only one or two table) and Import back into Oracle table (it might one or two table tables).
    Could you please guide me that how can i do this using either sql server or oracle?
    We have oracle 9.2 and sql server 2005.
    Normally i do from flat file which is generated by source destination nand i dump into oracle using sql*loader but this time I have to directly extract/export the data from MS Sql server and load into Oracle table, mostly it will reload so i might doing any massaging data during the load.
    If you show me the detail approach, it will be really appreciated.
    I have access to Sql server but i don't how to use sql server to do this or using oracle as a daily job even becuase have to schedule the job for this as it will be a daily job.
    Thanks,
    poratips

    Unless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
    As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
    Justin

  • Using Oracle Forms Importing Data From SQL Server into Oracle Tables.

    Dear All,
    We are using Oracle Forms 10g in windows XP and having OAS 10g and Oracle database 9i.
    How can we import data from SQL Server 2005 into Oracle tables using Oracle Forms?
    Thanks & Regards
    Eidy

    I have no idea what "Oracle Hetrogenius Services" is, so I can't help you with that, sorry.
    SQL Developer might also assist you. SQL Developer can connect to SQL Server as well as Oracle and has some tools for migration. See the documentation for details:
    http://download.oracle.com/docs/cd/E12151_01/doc.150/e12156/toc.htm
    For additional help on using SQL Developer for this task, please consult Support or the SQL Developer forum: SQL Developer
    Hope this helps,
    Jacob

  • Fetch the data from sql server table to array

    In the following script i am fetching the servers details from text file. Please anyone help me to get the same information from sql server database table. with using this query
    "SELECT DISTINCT [server_name]
    FROM
    Servers] where
    Status='1'"
    $ServerName =Get-Content "c:\servers\servers.txt"
     foreach ($Server in $ServerName) {
         if (test-Connection -ComputerName $Server -Count 4 -Delay 2 -Quiet ) {
           write-output "$Server is alive and Pinging `n"
           } else {
    Write-output "TXUE $Server seems dead not pinging"

    i have tested it is not working..
    =@"
    SELECT DISTINCT [server_name] FROM Servers] where Status='1'
    $connection
    =new-objectsystem.data.sqlclient.sqlconnection(
    "Data Source=xxx;Initial Catalog=xxx;Integrated Security=SSPI;”)
    $adapter
    =new-objectsystem.data.sqlclient.sqldataadapter($query,
    $connection)
    $table
    =new-objectsystem.data.datatable
    $adapter
    .Fill($table)
    | out-null
    $compArray
    =@($table)
    ##### Script Starts Here ######
    foreach($Serverin$ServerName)
    if(test-Connection-ComputerName$Server-Count4
    -Delay2
    -Quiet)
    write-output"$Server
    is alive and Pinging `n"
    else{
    $query

Maybe you are looking for

  • SQL Server 2008 - RS - Loop of multiple Bulk Inserts

    Hi, I want to import multiple flat files to a table on SQL Server 2008 R2. However, I don't have access to Integration Services to use a foreach loop, so I'm doing the process using T-SQL. Actually, I'm using manually code to which file to introduce

  • Wrong certificate in RDS Deployment 2012 R2

    Hi all!  I've just deployed RDS in my lab-enviroment and its working as it should (as far as I can see) internally. Now, im trying to get it to work externaly using a RDS-gateway. Currently, its possible to access the RDweb-server, authenticate and I

  • LoopCounter in XSLT

    I am struggling to figure out how to reference loopCounter variable in XSLT. This works for me: <db:P_MY_INPUT_PARAM> <xsl:value-of select="$myKeyList/ns1:myKeyList/rqst:myKey[*1*]"/> </db:P_MY_INPUT_PARAM> However, instead of always mapping the firs

  • Media encoder didn't export my yellow background from AE in black

    I have a composition in After Effects CC with a background color yellow. If I make a rendering in AE with AVI format, all is ok but the file is very heavy. But if I use Media Encoder CC and I export in any format, my yellow background become black !!

  • ICal Events Deleted, Don't Have MobileMe, Have TM Running, Help

    Okay, so out of the blue I now only have this month's calendar events (Jan 11') in iCal. Everything else is GONE. Running iMac w/OS 10.5.8. iCal 3.0.8 I have several years worth of events that are now gone. I have not manually used the backup feature