SQL 2005 Linked server to Oracle append

Hi Oracle Exprets,
i am using an SQl 2005 linked server too pull data from specific table in Oracle data base.
the thing is i have to pull data daily and append this data to the exsisting table.
here is my code :
EXEC sp_tables_ex @table_server ='LINKED_ORA',@table_schema='Myschema'
INSERT INTO dbo.ARS20091
SELECT * FROM OPENQUERY(LINKED_ORA,
'SELECT
TROUBLEID,
CREATE_DATE,
DATE ''1970-01-01'' + CREATE_DATE / 24 / 60 / 60
CREATEDATE
FROM CLIENT_TROUBLE
WHERE CREATE_DATE between ''1230768001'' AND ''1239043005''');
GO
this code works but i have to change the date daily and do a complete insert in a new table.
Is there a way to append data daily ?
thanks

Hi sanjay,
but why sysdate is giving me the today's date and when i use getdate ...it does not give me anything..
i am using openquery tooracle data base..usually i have to use Oracle command..
Mo..

Similar Messages

  • Trigger problem on Sql Server with linked server to Oracle

    Hi All,
    I have a simple insert trigger on Sql Server 2005, it uses linked server to Oracle.
    like that ;
    USE [YTM08]
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ANSI_NULLS ON
    go
    ANSI_WARNINGS ON
    CEATE TRIGGER [dbo].[YTM_TBLSTSABIT_I]
    ON [dbo].[TBLSTSABIT] FOR INSERT
    AS
    BEGIN
    INSERT INTO YTM_ORACLE..SECTOR.STOCKS
    stock_name,
    stock_code,
    insert_date
    SELECT
    SBT.STOCKNAME,
    SBT.STOCKCODE,
    GETDATE()
    FROM INSERTED SBT
    END
    The YTM_ORACLE is a linked server and it's provider is OraOLEDB.Oracle.
    Trigger does not works for that linked server but other triggers for local
    sql server works fine...
    I get this error from sql server
    'Heterogeneous queries require the ANSI_NULLS and
    ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.'
    Does someone know how to solve this issue the right way?
    Thanks in advance.
    Thanks !
    Adam

    Hi Lars,
      Thanks for the data. I've already read this note and configure all this parameters. But when I'm executing the Create Source System in the BI system the process dies.
      If I look into the logs I see this:
    M  call semaphore clean-up function ...
    M  ***LOG Q0E=> DpSigGenHandler, Exception (c06d007e) [dpnttool.c   432]
      That's the reason why I start guessing about other possible problem.
    Regards

  • SQL Server linked server to Oracle

    We have a SQL Server instance with a linked server to Oracle 9i.  When doing a select * (from Oracle) into some_table everything works as expected.
    There is a project to move the SQL Instance to a new clustered server.  We confirmed that the OS, SQL and Oracle Driver versions are the same.  The problem is that when we run the exact same statement the table is being created with unicode columns.
    For Example:
    Oracle
    Col1 Varchar2(20),
    Col2 Varchar2(100)
    Select into on current SQL Instance creates
    Col1 Varchar(20),
    Col2 Varchar(100)
    Select into on new SQL Instance creates
    Col1 NVarchar(20),
    Col2 NVarchar(100)
    Any help to identify how to resolve this issue?
    Thank You,
    Michael

    Hi Michael,
    The varchar2 data type in Oracle database and nvarchar data type in SQL Server is mapped to DT_WSTR data type in SSIS, while the varchar data type in SQL Server is mapped to DT_STR in SSIS. In your case, when loading the Oracle data to nvarchar columns SQL
    Server table, you can extract Oracle data using a source adapter and directly load the data to the SQL Server table. When loading the Oracle data to varchar columns SQL Server table, you need to convert the DT_WSTR data type columns to DT_STR data type columns
    before inserting into SQL Server table. To do the data conversion, you can use a Data Conversion Transform.
    If you want to do it by using T-SQL rather than SSIS, please ask a new question in the T-SQL forum where you can get dedicated support.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • SQL Server 2K "Linked Server" to Oracle 9i Release 2 via "Oracle Provider

    Hi,
    I'm trying to set up a SQL Server 2000 "Linked Server" to Oracle 9i Release 2 via "Oracle Provider for OLE DB". I have downloaded and installed "Oracle Provider for OLE DB Release 9.2.0.2.0"
    My SQL*Net alias/datasource in tnsnames.ora works (It passes the test in "Net 9i Configuration Assistant", I can connect from SQL*Plus, and I can get a Linked server going with the "Microsoft OLE DB Provider for Oracle").
    When I set up my Linked Server with Oracle Provider for OLE DB, I need to supply the following three fields (with description from the read-only field at the bottom of the "Linked Server Properties)
    Product name: (The product name is the OLE DB data source to add as a linked server.)
    Data source: (The data source is usually the name of the server or filename.)
    Provider string: (This is the entire provider string.)
    Here is my tnsnames.ora entry that works as described above (names may have been changed to protect the innocent)...
    PROD9I.XYZ.LOCAL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = nn.nn.nn.nn)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PROD.ora2.xyz.mno.com)
    With every combination of values I have tried for these fields, when I try to use the Linked Server I get this error message...
    Could not create an instance of OLE DB provider 'OraOLEDB.Oracle'.
    OLE DB error trace [Non-interface error:  CoCreate of DSO for OraOLEDB.Oracle returned 0x80040154].
    Any help would be greatly appreciated
    Thank you,
    Daniel Jameson

    Thanks Norman.
    Well, I've made it a step closer. I uninstalled everything Oracle from my machine and reinstalled the 9i stuff, including the Oracle OLE DB Provider. Now, after I set up the linked server, and I try to view the Tables or Views under the Linked Servers, I get this error message...
    Error 7399: OLE DB provider 'OraOLEDB.Oracle' reported an error.
    OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' IDBINitialize::Initialize returned 0x80004005:   ].
    Does anyone have any idea what this is about? My other Linked Server using the same Oracle SQL*Net alias, but using the Microsoft OLE DB Provider, works fine.

  • Syntax to query a MSSQL 2008R2 linked server from Oracle

    Hi,
        I would know if it's possible to query a MSSQL 2008R2 linked server from Oracle. Actually I can query local MSSQL databases from Oracle using dg4odbc without problem but how can I query the linked servers configured on the MSSQL side ?
    From MSSQL, I can query those linked servers using the [linked server name].[catalog].[owner].[table] syntax but using select * from [linked server name].[catalog].[owner].[table]@oracle_dblink_name syntax from the oracle side throw this error:
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    I tried some syntax variations, e.g. putting double quotes around the object name without luck. After some hours to find a solution I'm out of idea...
    So please if someone had a clue on this it would be very helpfull.
    Some info:
    Oracle 10g 10.2.0.5 Enterprise Edition x64
    Oracle Linux 5.9 Enterprise Edition x64
    MSSQL 2008R2 Enterprise x64
    Windows Server 2008R2 Enterprise x64
    Oracle 11gR2 Enterprise x64 for dg4odbc on MSSQL side
    SQL Server Natice Client 10.0 used as ODBC driver

    Hi kgronau,
                    Maybe I'm not clear in my explanations, sorry.
    I want, from Oracle, to query a MSSQL linked server.
    Basically I want to do that, if possible:
    Oracle --> MSSQL --> linked server --> MSSQL
        ^                                                         ^
        |                                                          |
        ---------------->------------------->--------------------
    and maybe have a clue about the syntax to be used.
    Knowing that querying the linked server directly form MSSQL is working and querying from Oracle to local MSSQL db is working too.
    Using the right syntax should lead me to succes, am I right ? Or maybe its something that cannot be done using oracle dblinks ?
    Thanks

  • MS SQL 2005 x64 Linked Server to Oracle 10g 32bit

    I need to connect to a 10.2.0.4 Oracle DB from a SQL Server 2005 x64 on W2003.
    The Instant Client installed is 10.2.0.1 with ODP 10.2.0.3, which is used to connect to another Oracle DB.
    I get de error ORA-12154 while doing the linked server query.
    Do I really need to update de Instant Client?
    Thankx and some more info.
    I can reach it with TOAD from my laptop which has Instant Client 11.1.0.7.
    I followed several how-tos while configuring the linked server.
    The other linked server supposely works but I'm not sure and don't know the Oracle version.

    Hi sanjay,
    but why sysdate is giving me the today's date and when i use getdate ...it does not give me anything..
    i am using openquery tooracle data base..usually i have to use Oracle command..
    Mo..

  • SQL 2000 linked server to MSDAORA returns "provider did not ...

    Hi, I have a linked server setup in SQL 2000 using "MS OLE DB Provider for Oracle" to connect to a Oracle 9.2 DB on another server.
    This works fine apart from when the Oracle database is being backed-up, in which case any query against it returns: -
    Step Error Source: Microsoft OLE DB Provider for SQL Server
    Step Error DescriptionLE DB provider 'MSDAORA' reported an error. The provider did not give any information about the error. (Microsoft OLE DB Provider for SQL Server (80040e14): OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].)
    This is OK when the backup is running but we could be missing important messages if the Oracle errors are not able to be passed back correctly.
    Any help would be much appreciated.
    Regards,
    Richard

    did you find any answers? I have encountered the same problem

  • SQL 2000 LINKED SERVER ERROR 7303 WITH SQL 2012 ON WINDOWS SERVER 2012 R2

    Hi all,
    I have a problem with SQL Server 2012 and a linked server for SQL 2000 database.
    System specification:
    Windows server 2012 64 bit
    SQL SERVER 2012 64 bit
    REMOTE SERVER SQL 2000 32 bit
    I've installed sql native client 32bit,create a SYSTEM DSN odbc connection with "SQL Server" driver named "MYSERVER".
    Create a linked server with the query below in SQL 2012:
    EXEC master.dbo.sp_addlinkedserver @server =N'MYSERVER', @srvproduct=N'MYSERVER', @provider=N'MSDASQL', @datasrc =N'MYSERVER', @location=N'System';
    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'MySERVER',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
    GO
    but when i browse the linked server i receved error 7303.

    You need 64-bit MSDASQL. It is the bitness of the server you are connecting from that matters. 64-bit executables cannot hook into 32-bit DLL.
    However, I suspect that you will not get things to work anyway. At least I have not seen anyone this far who has been able to set up a linked server from SQL 2012 to SQL 2000. I know that when I tried this, the following providers had this result:
    SQLNCLI11 - does not support connections to SQL 2000.
    SQLNCLI10 - failed with some obscure message that I don't recall.
    SQLNCLI - Don't recall that the problem was here.
    SQLOLEDB - SQLOLEDB is always replaced with the most recent version of SQLNCLI, so this fails because of lack of support.
    I don't think I got through all version of the ODBC drivers, though.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL 2012 Linked Server connection from SQL 2000

    Hi,
    Does anyone know if it's possible to create a linked server connection in SQL 2000 to a SQL 2012 instance?
    If so, which provider should I use?
    Many Thanks,
    Phil

    Hi Shanky,
    I'm afraid you misunderstood my Q. The above posts show how to create a linked server connection FROM SQL2012 --> SQL 2000.
    I'm trying to create a linked server connection FROM SQL 2000 --> SQL 2012.
    Does anyone know if it's possible?
    Many Thanks,
    Phil
    I guess you dont read posts patiently below link ,which i also posted in my first reply, has details about the same
    http://social.msdn.microsoft.com/Forums/en-US/2e02c603-e28d-49eb-b073-548c59732b5d/linked-server-from-sql2012-to-sql2000?forum=sqlsetupandupgrade
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Failing to install SQL 2005 on server.

    I am failing to install SQL 2005 on the server with message below:-
    TITLE: Microsoft SQL Server 2005 Setup
    The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
    For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=MicrosoftSQLServer&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=29503&EvtType=sqlsetuplib%5cservice.cpp%40Do_sqlScript%40sqls%3a%3aService%3a%3aStart%40x42b
    BUTTONS:
    &Retry
    Cancel
    It was removed after it started developing problems. We tried to go to MS SQL site buts its not opening the site. I thought maybe you could help although it is a SQL error. For some time we are failing to run SAP B1 because of this.
    Thank you.

    Hi,
       Check the SQL Services  go to start->AllPrograms->Microsost
    SQL Server 2005->ConfigurationTools->SQL Server Configuration Manager
    Pl check The following Services is Running State
    1.SQL Server Browser
    2.SQLServer(MSSQLSERVER)
    Regards
    JambuLingam.P

  • Upgrade sql 2000 win xp  to sql 2005 win2003 server

    Hi,
    We had installed sap b1 2005b on winxp and database  as sql 2000.
    Now ,we want to install sap b1 2007b on win 2003 and database as sql 2005.
    Can the sql 2000 winxp database backup  be restored on sql 2005 win2003 database.
    Since both the OS are different can the backup be restored .
    Pls let me know about the same.
    Regards,
    Rajeev

    Hi Rajeev
    step 1) Install SQL Server 2005.
    step 2) Install [SAP Business One|http://www.brio.co.in/products/sap-business-one/] 2005
    step 3) Get the new license key for your windows 2003 server if you dont have
    step 4) Create a company with same name and database name this will create a company record in SBOCommon database
    step 5) Take the backup of the database of the company in MS SQL 2000.
    step 6) Restore it on your windows 2003 and sql server 2005 system
    step 7) Download an upgrade for 2005 to 2007 from software download center
    step 8) Run the upgrade exe
    THATS IT, YOU ARE ON YOUR NEW SYSTEM.
    Regards
    [Abdul Muneem|http://www.brio.co.in]
    Edited by: Muneem Abdul on Nov 22, 2010 12:22 PM

  • DI API Deadlocks in SQL 2005 database server

    Hello All,
    I have an Issue, which is coming on large databases ( > 50GB) and number of users >  20.
    I have read the following notes
    1269591, 1489753, 1318311, 1231444 , 1344641 , 1316554
    also contributed in the following thread:
    Workaround:
    Each SAP B1 Client is using an addon, which do a WM (Warehouse management) based on WHSE Journal. Until upgraded to 2007 version, this was working fine, no issue came up only system was slow.
    Process with pseudo code like this
    'incoming cases - when an item is entering into the warehouse
    Add Logistics documents (action success = true)
    - start transaction
      - check Warehouse journal
      - record changes done by this document (based on oinm) into (UDT)
    - finish transaction
    'outgoing cases - where an item is carried out from the warehouse - create a self pick list example: sales order:
    start transaction
    - loop on every rows of the sales order
      - read ordered quantity
      - look for place where it is stored,
    - if found make  a reservation in (UDT)
      - add position to self created pick list  (UDT)
    finish  transaction
    'release from warehouse
    start transaction
      - look for pick list position (UDT)
      - reduce stock value (UDT)
      - update pick list  with packed quantity (UTD)
      - create delivery note
    finish  transaction
    Depending from activity the users receive various error messages like Could not commit transaction / Deadlock ...  / -2038 Internal error xxxx messages, when trying to access to UDT-s or any marketing documents, and the system is frozen. I go to activity monitor, and check and tell them which client is causing dead locks, they log off ,and can continue work or if the process runs to timeout, it sends the error message to SAP B1 Client.
    Also we have an addon which reads (only reads) data from database from OITM / OITW / and one of these UDT above. (queries against stock value from UDT). here we receive 2 type of error messages
    - Deadlock
    - Timeout
    I know these messages are coming from: other computers /Users are issueing documents in transaction.
    Any ideas to resolve this issue / has anybody happened this issue ?
    Every ideas, comments are welcome.
    The system is b1 2007 SP 01 PL 10. Average document position between 50-100.
    Solution Architect team? Any workaround?
    Regards
    János

    HI Janos,
    I also faced little bit same type of Issue in one of the project.
    Please look
    Link: [Large data processing Issue | SAP Hanging Problem using Transactions;
    After applying this my issue was resolved.
    regards:
    Sandy
    Edited by: Sandeep Saini | Roorkee | India on Sep 6, 2010 7:16 PM

  • Ms sql server linked server with OraOLEDB.Oracle provider session handling

    Hi everyone!!
    Here's my situation:
    I have a MS SQL Server 2008 R2 with a linked server to Oracle via OraOLEDB.Oracle provider.
    I use a .net application to open a connection to my sql-server, execute a select that collects data through the linked-server-connection from the oracle database and after that I close to connection to the sql.
    It does work so far,
    but when I start my application, exit it proberly and start it again it seems that i get the same session as before (which is for some reasons very bad).
    Is that the right/normal behavior?
    Is there any way to avoid that?!
    How does the OraOLEDB.Oracle provider handle the sessions if used in/as a linked server?
    thanks and greetings,
    exoc
    Edited by: 944414 on Jul 4, 2012 5:43 AM

    Hii Rouann,
    Does the error occur when you call the stored procedure from SSIS package and map SSIS variables to the parameters in the stored procedure? Can you run the store procedure from SSMS properly? If you can run the stored procedure from SSMS, the issue seems
    to occur due to the date format mismatch between the SSIS variables and the parameters in the stored procedure.
    If you cannot run the stored procedure from SSMS as well, the issue should occur due to the incorrect data conversion within the store procedure itself as Tom mentioned.
    Regards,
    Mike Yin
    TechNet Community Support

  • How to create a linked server to SQL in Oracle?

    I am able to create a linked server to Oracle in SQL.. But I do not know the steps to create a linked server too SQL in Oracle.
    How to create a linked server to SQL in Oracle? After creating the linked server to SQL, I would like to create triggers in Oracle DB to insert records into SQL DB.

    There are 2 products in Oracle you can use to link to a MS SQl Server. The first one is for free and it is called Database Gateway for ODBC. With a suitable 3rd party ODBC driver you can connect to any foreign database. The second gateway is our commercial gateway and it is called Oracle Database Gateway for MS SQL Server. It is designed for MS SQl Server connections and more powerful then Dg4ODBC. It know how to map a lot of Oracle functions to SQL Server equivalents and you can also use it to directly call SQL Server procedures or functions. This dedicated SQL server gateway is also able to participate in distributed transactions.
    But again, this is a commercial gateway and you have to purchase a license for that second gateway, the Database Gateway for MS SQl Server.
    - Klaus

  • LINKED SERVER ISSUE on ORACLE DATABASE

    Hi everyone
    I have SQL 2008 R2 Running on Windows server 2003 R2 OS.
    I have created a linked server to ORACLE 11
    I have may jobs running process against this linked server and thy work fine
    But soddenly I receive this error :
    Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "WMS". [SQLSTATE 42000] (Error 7303).  The step failed
    In this scenario the SQL SERVER AGENT Account is the Domain administrator.
    When I restart the Server it begin to work fine again but from time to time I receive again the error mentioned above.
    Have any one pass through this issue?

    Is the network connection to Oracle box stable? Is it inside a firewall?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Smart Sync Related Queries

    A. Any guidelines in defining parent chlid relation ships and association when making BAPI Wrappers???     Any documents/note/links. C. How can we separate BAPI Wrappers Interface and filtering rules. Can I bring my Filtering /distribution rules defi

  • Oracle Jdeveloper 11g R1 has a Bug?-- Swing Application Deploy Error

    Oracle Jdeveloper 11g R1 (11.1.1.2.0) (build 5536) 1. Create an empty swing application. File-->New-->Applications-->Java Desktop Application New-->Swing/AWT-->Frame 2. Project properties--->Deployment: Create new JAR Deployment Profile: test 3. Edit

  • Product wise credit limit

    My requirment is that how can we maintain Product credit material As we wants to keep a seperate credit  limit for one material out of 100 in same sales area and same group. and for same customer ? This is business requirmetn as we need to put these

  • I use Yahoo mail. It requires Java which I cannot activate. must thus use "Clasic" with important features missing.

    Because my Acer computer with Vista crashed twice, I changed from Thunderbird to Yahoo mail <[email protected]> (I live in Canada so why the "uk", I do not know). I upgraded Firefox to version 4. For the past week I am told that I must activate my Ja

  • Maxl : ASO Filters and users

    Hi, I will like to create a MaxL script that will list all the users/groups and the filters assigned to each of them. I'm planning to use the following commands, but I can't find the command that will help me link the user (or group) to his assigned