How to insert into SQL server table form oracle forms

I created a form with oracle as my database. But there one trigger where I need to insert the data into a sql server table.
Is this possible. If so can any help me out.
Thanks in advance.
Asha

Hi,
You can insert into sql server database using the following steps
Note: Check wether you are using Forms 32 bit drivers. If not the Odbc data source will not work.
step 1: Create ODBC data source for SQL server(one time creation);
step 2: Logout from Oracle and login to SQL server giving the user name,password and host string as odbc:<odbc datasource name>;
step 3: use EXEC SQL statement to insert the values into the SQL server and then logout and login again to your oracle database.
Second Method.
Check the sql server documentation to insert the values using command line parameters. Then you can call the host command to execute this.
Third Method.
Write a VB exe to enter the values in the sql server making two connections one to oracle another to SQL server and then getting values from Oracle and putting in the SQL server database. You can call this exe using the Host command.
Hope this will help You.
Regards
Gaurav Thakur

Similar Messages

  • How to select data from 3rd row of Excel to insert into Sql server table using ssis

    Hi,
    Iam having Excel files with headers in first two rows , i want two skip that two rows and select data from 3rd row to insert into Sql Server table using ssis.3rd row is having column names.

                                                         CUSTOMER DETAILS
                         REGION
    COL1        COL2        COL3       COL4           COL5          COL6          COL7
           COL8          COL9          COL10            COL11      
    1            XXX            yyyy         zzzz
    2            XXX            yyyy        zzzzz
    3           XXX            yyyy          zzzzz
    4          XXX             yyyy          zzzzz
    First two rows having cells merged and with headings in excel , i want two skip the first two rows and select the data from 3rd row and insert into sql server using ssis
    Set range within Excel command as per below
    See
    http://www.joellipman.com/articles/microsoft/sql-server/ssis/646-ssis-skip-rows-in-excel-source-file.html
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to connect to SQL server 2000 with Oracle Form

    Hi,
    I'm looking for the document of how to connect "SQL Server 2000" with Oracle Form 6i. Anyone knows that?

    Shay or other knowledgeable folks,
    Is there a way to utilize the wizard for "Business Tier > ADF Business Components > Business Components from Tables" for SQL Server 2000, 2005 or 2008. I can successfully execute sql via java programmatically or import a table from SQL Server with "Business Tier > ADF Business Components > Entity Object" wizard, but the Business Components from Tables simply doesn't see any tables under any schema. Without the "Business Components from Tables", i don't get the referential constraints imported into the application and to code all those from scratch is just not as elegant. So far i have only utilized the sql server jdbc driver from Microsoft (versions, 1.1, 1.2 and 2.0). Is there an alternative client that i need to use to enable selecting tables from that "Business Components from Tables" wizard. Is this a limitation of SQL Server, the jdbc driver or the wizard itself? Did anybody else experience the same issues? I am using Jdeveloper 11.1.1.0.1 against SQL Server 2005 (currently)
    Thanks,
    Andy

  • RE:ora-28500 when trying to insert into SQL Server table

    Hi all!
    I'm getting this when i attempt to insert into my table test in a SQL Server database. As u can see from the select, the database link seems ok. Any ideas plz. Thnx..
    SQL> select "idAges" from test@try2;
    no rows selected
    SQL> insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','');
    insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','')
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver][SQL
    Server]Cannot insert explicit value for identity column in table 'test' when
    IDENTITY_INSERT is set to OFF. (SQL State: 23000; SQL Code: 544)
    ORA-02063: preceding 2 lines from TRY2

    IDENTITY_INSERT on works only for particular session and for one table. It's not global variable.
    The only idea what I have is to create link from MS Sql to Oracle (right now You have oracle ->ms sql)and then before insert You will set identity_insert on and will run insert.

  • How to Select from Oracle 8i database and insert into Sql Server 2005 datab

    Hi how to Select from Oracle 8i and insert into Sql Server 2005.
    Source db as Oracle 8i
    Target db as Sql Server 2005.
    I need to select one table data from Oracle 8i & insert into Sql Server 2005
    Thanks

    Thanks Khan..
    Is there is any query (OPENQUERY) available for that?
    Regards..

  • Running INSERT into SQL Server using Heterogeneous Services

    I am running into a show stopping issue trying to insert into a SQL Server table via Oracle.
    Basically, I have my Heterogeneous Services set up correctly and I am able to hit the SQL Server database with my INSERT statement. But what is happening is I seem to be manually controlly row locks. I believe HS is issuing the following to the server before my INSERT statement is run:
    SET TRANSACTION ISOLATION LEVEL READ COMMITTED
    SET IMPLICIT_TRANSACTIONS ON
    Also, it does not seem that I ever issue the COMMIT TRANSACTION
    command. This leaves the row locked forever... unable to complete the
    insert generating an error and not inserting my record.
    I would GREATLY appreciate any help you could provide, this is a critical issue.
    Thanks in advance,
    ivalum21

    ORA-02047: cannot join the distributed transaction in progress
    ORA-06512: at "MY_PACKAGE_NAME", line 263
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC]DRV_Execute: DB_ODBC_ENGINE (1645): ;
    [Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion
    from data type varchar to data type money, table 'tableA',
    column 'total_amount'. Use the CONVERT function to run this query. (SQL
    State: 37000; SQL Code: 260)
    ORA-02063: preceding 2 lines from SQLSERVER_LINK
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 875
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 791
    ORA-06512: at "RCDTPUMP.CAMPUSCALL_DATAPUMP_UNI", line 1156
    ORA-06512: at line 1
    That is what I get when I take out the TO_NUMBER()
    Message was edited by:
    ivalum21

  • Recreating SQL Server Tables on Oracle

    Hello,
    I need to recreate several SQL Server tables in Oracle and am trying to figure out if there is an easier way to do it other than manually recreating them.
    I have the SQL Server table scripts, and I have data load xls files that also contain the column names. I use TOAD for Oracle to do my database management, but there is currently no way to autmoatically create a table based on an external file.
    Does anyone have any suggestions?
    Thanks,
    Christine

    Manually re-creating these SQL Server tables for Oracle is exactly the right thing to do.
    SQL Server != Oracle
    In other words, there are numerous differences. You need to look at each table and decide on the type of table (hash table, index organised table, partitioned tables), whether to cluster tables, the types of indexes to use, the data types for the columns to use (Oracle does not have boolean or auto incrementing data types). Oracle supports LONG, RAW, CLOB and BLOB for dealing with different types of binary and large data structures. LONG for example should not be used anymore. There are also specialised data types like BFILE. One can also define your own SQL data types.
    You will only be doing yourself a favour, and the final database application, by going through the learning curve and manually converting each and every table. And no, it is not a huge task either. It sounds a lot more daunting that what it really is.

  • How to convert from SQL Server table to Flat file (txt file)

    I need To ask question how convert from SQL Server table to Flat file txt file

    Hi
    1. Import/Export wizened
    2. Bcp utility
    3. SSIS 
    1.Import/Export Wizard
    First and very manual technique is the import wizard.  This is great for ad-hoc and just to slam it in tasks.
    In SSMS right click the database you want to import into.  Scroll to Tasks and select Import Data…
    For the data source we want out zips.txt file.  Browse for it and select it.  You should notice the wizard tries to fill in the blanks for you.  One key thing here with this file I picked is there are “ “ qualifiers.  So we need to make
    sure we add “ into the text qualifier field.   The wizard will not do this for you.
    Go through the remaining pages to view everything.  No further changes should be needed though
    Hit next after checking the pages out and select your destination.  This in our case will be DBA.dbo.zips.
    Following the destination step, go into the edit mappings section to ensure we look good on the types and counts.
    Hit next and then finish.  Once completed you will see the count of rows transferred and the success or failure rate
    Import wizard completed and you have the data!
    bcp utility
    Method two is bcp with a format file http://msdn.microsoft.com/en-us/library/ms162802.aspx
    This is probably going to win for speed on most occasions but is limited to the formatting of the file being imported.  For this file it actually works well with a small format file to show the contents and mappings to SQL Server.
    To create a format file all we really need is the type and the count of columns for the most basic files.  In our case the qualifier makes it a bit difficult but there is a trick to ignoring them.  The trick is to basically throw a field into the
    format file that will reference it but basically ignore it in the import process.
    Given that our format file in this case would appear like this
    9.0
    9
    1 SQLCHAR 0 0 """ 0 dummy1 ""
    2 SQLCHAR 0 50 "","" 1 Field1 ""
    3 SQLCHAR 0 50 "","" 2 Field2 ""
    4 SQLCHAR 0 50 "","" 3 Field3 ""
    5 SQLCHAR 0 50 ""," 4 Field4 ""
    6 SQLCHAR 0 50 "," 5 Field5 ""
    7 SQLCHAR 0 50 "," 6 Field6 ""
    8 SQLCHAR 0 50 "," 7 Field7 ""
    9 SQLCHAR 0 50 "n" 8 Field8 ""
    The bcp call would be as follows
    C:Program FilesMicrosoft SQL Server90ToolsBinn>bcp DBA..zips in “C:zips.txt” -f “c:zip_format_file.txt” -S LKFW0133 -T
    Given a successful run you should see this in command prompt after executing the statement
    Starting copy...
    1000 rows sent to SQL Server. Total sent: 1000
    1000 rows sent to SQL Server. Total sent: 2000
    1000 rows sent to SQL Server. Total sent: 3000
    1000 rows sent to SQL Server. Total sent: 4000
    1000 rows sent to SQL Server. Total sent: 5000
    1000 rows sent to SQL Server. Total sent: 6000
    1000 rows sent to SQL Server. Total sent: 7000
    1000 rows sent to SQL Server. Total sent: 8000
    1000 rows sent to SQL Server. Total sent: 9000
    1000 rows sent to SQL Server. Total sent: 10000
    1000 rows sent to SQL Server. Total sent: 11000
    1000 rows sent to SQL Server. Total sent: 12000
    1000 rows sent to SQL Server. Total sent: 13000
    1000 rows sent to SQL Server. Total sent: 14000
    1000 rows sent to SQL Server. Total sent: 15000
    1000 rows sent to SQL Server. Total sent: 16000
    1000 rows sent to SQL Server. Total sent: 17000
    1000 rows sent to SQL Server. Total sent: 18000
    1000 rows sent to SQL Server. Total sent: 19000
    1000 rows sent to SQL Server. Total sent: 20000
    1000 rows sent to SQL Server. Total sent: 21000
    1000 rows sent to SQL Server. Total sent: 22000
    1000 rows sent to SQL Server. Total sent: 23000
    1000 rows sent to SQL Server. Total sent: 24000
    1000 rows sent to SQL Server. Total sent: 25000
    1000 rows sent to SQL Server. Total sent: 26000
    1000 rows sent to SQL Server. Total sent: 27000
    1000 rows sent to SQL Server. Total sent: 28000
    1000 rows sent to SQL Server. Total sent: 29000
    bcp import completed!
    BULK INSERT
    Next, we have BULK INSERT given the same format file from bcp
    CREATE TABLE zips (
    Col1 nvarchar(50),
    Col2 nvarchar(50),
    Col3 nvarchar(50),
    Col4 nvarchar(50),
    Col5 nvarchar(50),
    Col6 nvarchar(50),
    Col7 nvarchar(50),
    Col8 nvarchar(50)
    GO
    INSERT INTO zips
    SELECT *
    FROM OPENROWSET(BULK 'C:Documents and SettingstkruegerMy Documentsblogcenzuszipcodeszips.txt',
    FORMATFILE='C:Documents and SettingstkruegerMy Documentsblogzip_format_file.txt'
    ) as t1 ;
    GO
    That was simple enough given the work on the format file that we already did.  Bulk insert isn’t as fast as bcp but gives you some freedom from within TSQL and SSMS to add functionality to the import.
    SSIS
    Next is my favorite playground in SSIS
    We can do many methods in SSIS to get data from point A, to point B.  I’ll show you data flow task and the SSIS version of BULK INSERT
    First create a new integrated services project.
    Create a new flat file connection by right clicking the connection managers area.  This will be used in both methods
    Bulk insert
    You can use format file here as well which is beneficial to moving methods around.  This essentially is calling the same processes with format file usage.  Drag over a bulk insert task and double click it to go into the editor.
    Fill in the information starting with connection.  This will populate much as the wizard did.
    Example of format file usage
    Or specify your own details
    Execute this and again, we have some data
    Data Flow method
    Bring over a data flow task and double click it to go into the data flow tab.
    Bring over a flat file source and SQL Server destination.  Edit the flat file source to use the connection manager “The file” we already created.  Connect the two once they are there
    Double click the SQL Server Destination task to open the editor.  Enter in the connection manager information and select the table to import into.
    Go into the mappings and connect the dots per say
    Typical issue of type conversions is Unicode to non-unicode.
    We fix this with a Data conversion or explicit conversion in the editor.  Data conversion tasks are usually the route I take.  Drag over a data conversation task and place it between the connection from the flat file source to the SQL Server destination.
    New look in the mappings
    And after execution…
    SqlBulkCopy Method
    Sense we’re in the SSIS package we can use that awesome “script task” to show SlqBulkCopy.  Not only fast but also handy for those really “unique” file formats we receive so often
    Bring over a script task into the control flow
    Double click the task and go to the script page.  Click the Design script to open up the code behind
    Ref.
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How to insert into two differents tables at the same time

    Hi
    I'm newer using JDev, (version 3.1.1.2 cause the OAS seems to support just the JSP 1.0)
    and I want to insert into two differents tables at the same time using one view.
    How can I do that ?
    TIA
    Edgar

    Oracle 8i supports 'INSTEAD OF' triggers on object views so you could use a process similar to the following:
    1. Create an object view that joins your two tables. 'CREATE OR REPLACE VIEW test AS SELECT d.deptno, d.deptname, e.empname FROM DEPT d, EMP E'.
    2. Create an INSTEAD OF trigger on the view.
    3. Put code in the trigger that looks at the :NEW values being processed and determines which columns should be used to INSERT or UPDATE for each table. Crude pseudo-code might be:
    IF :NEW.deptno NOT IN (SELECT deptno FROM DEPT) THEN
    INSERT INTO dept VALUES(:NEW.deptno, :NEW.deptname);
    INSERT INTO emp VALUES (:NEW.deptno, :NEW.empname);
    ELSE
    IF :NEW.deptname IS NOT NULL THEN
    UPDATE dept SET deptname = :NEW.deptname
    WHERE deptno = :NEW.deptno;
    END IF;
    IF :NEW.empname IS NOT NULL THEN
    UPDATE emp SET empname = :NEW.empname
    WHERE deptno = :NEW.deptno;
    Try something along those lines.
    null

  • Select from tabA & tabB then insert into tabC (these tables ok for form?)

    hi everyone,
    i have a question for any of you who have a few mins to spare
    i have a bunch of tables that i will eventually create a bunch of corrisponding forms for... now i want one of the forms to allow the end user to search for records from two tables,,, select some or all of the rows and then use them in either a delete or update statement....
    my table set up is shown below:
    SQL> desc BOOK_OUT_INFO
    Name Null? Type
    BOOK_OUT_ID NUMBER(10)
    BOOK_CN VARCHAR2(9)
    BOOK_CN_NUM NUMBER(3)
    BOOK_ISBN VARCHAR2(9)
    BOOK_TITLE VARCHAR2(100)
    BOOK_AUTHOR_NAME VARCHAR2(30)
    BOOK_STATUS VARCHAR2(4)
    EMPLOYEE_ID NUMBER(5)
    EMPLOYEE_NAME VARCHAR2(30)
    EMPLOYEE_ADDRESS VARCHAR2(100)
    EMPLOYEE_PHONE_NUMBER NUMBER(7)
    EMPLOYEE_DEPT VARCHAR2(15)
    EMPLOYEE_SID NUMBER(5)
    SQL> desc BOOK_IN_INFO
    Name Null? Type
    BOOK_CN VARCHAR2(9)
    BOOK_CN_NUM NUMBER(3)
    BOOK_ISBN VARCHAR2(9)
    BOOK_TITLE VARCHAR2(100)
    BOOK_AUTHOR_NAME VARCHAR2(30)
    BOOK_STATUS VARCHAR2(4)
    SQL> desc SEARCH_INFO
    Name Null? Type
    BOOK_ISBN NUMBER(9)
    BOOK_TITLE VARCHbefAR2(100)
    BOOK_AUTHOR_NAME VARCHAR2(30)
    ok so now.... i need to allow the user to search both BOOK_IN_INFO and BOOK_OUT_INFO, by BOOK_ISBN then select the records they require for use later and have them inserted into SEARCH_INFO....
    before i start making the forms is there anything i need to change in the tables?
    thanks all
    MUCH APPRECIATED
    RMMO

    I'll give you a hint on how you could solve it.
    Let's take BOOK_OUT_INFO table and try to insert some records from this table to SEARCH_INFO table.
    Create a button in BOOK_OUT_INFO block, lets call the block BLOCK1. The button would appear for all rows. Write this code in W-B-P trigger of the button.
    INSERT INTO TABLE SEARCH_INFO (BOOK_ISBN,BOOK_TITLE,BOOK_AUTHOR_NAME) VALUES (:BLOCK1.BOOK_ISBN, :BLOCK1.BOOK_TITLE, :BLOCK1.AUTHOR_NAME);
    COMMIT;
    MESSAGE('1 row inserted');MESSAGE('1 row inserted');

  • Loop Through Excel Files and Load into SQL Server Table

    I'm following the example here.
    https://www.youtube.com/watch?v=_B83CPqX-N4
    I'm pretty sure I did all the steps, but for some reason my project is not running.  I'm thinking there is a 32-bit or 64-bit issue lurking in here somewhere.
    Here's my error message.
    SSIS package "C:\Users\Ryan\Documents\Visual Studio 2010\Projects\Loop through Multiple Excel sheets and load them into a SQL Table\Integration Services Project1\Package.dtsx" starting.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Error: 0xC0209303 at Package, Connection manager "Excel Connection Manager": The requested OLE DB provider Microsoft.ACE.OLEDB.12.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.
    An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered".
    Error: 0xC001002B at Package, Connection manager "Excel Connection Manager": The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
    For more information, see http://go.microsoft.com/fwlink/?LinkId=219816
    Error: 0xC020801C at Data Flow Task, Excel Source [2]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. 
    There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error: 0xC0047017 at Data Flow Task, SSIS.Pipeline: Excel Source failed validation and returned error code 0xC020801C.
    Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.
    Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
    SSIS package "C:\Users\Ryan\Documents\Visual Studio 2010\Projects\Loop through Multiple Excel sheets and load them into a SQL Table\Integration Services Project1\Package.dtsx" finished: Failure.
    The program '[5392] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).
    I have 32-bit Excel and 64-bit SQL Server.  Is that the issue?  Can someone tell me what's wrong here?
    Thanks!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Sa-weeettttttt!!  Thanks.  I figured that's what it was.  For the benefit of others, this link shows you exactly how to make the modification recommended above.
    http://help.pragmaticworks.com/dtsxchange/scr/FAQ%20-%20How%20to%20run%20SSIS%20Packages%20using%2032bit%20drivers%20on%2064bit%20machine.htm
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to Insert into a temporary table

    Hi Experts,
    I have created a temp table in sql from vfp using the #prefix. But when I issue an insert command sqlexec returns negative.
    The code which I have used :
    =sqlexec(oConn, "Create table #smenu (code_ varchar(1), name_ varchar(50))")
    Table created successfully under tempdb database of sql
    m_result=sqlexec(oConn, "insert into #smenu values ('100','Police')")
    m_result returns negative.
    Kindly help.

    Try to create a permanent table:
    =sqlexec(oConn, "Create table temp_smenu (code_ varchar(1), name_ varchar(50))")
    m_result=sqlexec(oConn, "insert into temp_smenu values ('100','Police')")
    Temporary table has limited visibility.
    You need to drop table temp_smenu when finished.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to get into SQL Server - Installation done through DPM tool. DO not have SA password.

    HI Every one,
      Hope you guys having wonderful Friday. 
    well I have some weird situation so don't know some one can help me here .
    in Past some one has Installed SQL Server when installing  Microsoft DPM  ( Data Protection Manager) tool. that time person didn't added  any other AD group during installation. and do not have SA password either. 
    I have password under which SQL Server running but I am not able to login into SQL severer under that account. 
    what are the other ways to Log in into SQL?
    Thanks

    Hello,
    Please try the following and let us know:
    1. Open CMD with elevated privilages
    2. Type as below
    SQLCMD –S <Server_Name\Instance_Name>
    go
    CREATE LOGIN ‘<Login_Name>’ with PASSWORD=’<Password>’
    go
    SP_ADDSRVROLEMEMBER '<Login_Name>','SYSADMIN'
    go
    Now the login is added as SA. Login and reset the accounts required.
    Reference:
    ===================
    http://www.wikihow.com/Reset-SA-Password-in-Sql-Server
    http://blogs.technet.com/b/canitpro/archive/2012/11/26/the-sql-guy-post-30-how-to-recover-from-a-lost-sa-password-in-sql-server-2012.aspx
    Regards, Pradyothana DP. Please Mark This As Answer if it solved your issue. Please Mark This As Helpful if it helps to solve your issue. ========================================================== http://www.dbainhouse.blogspot.in/

  • Execute Sql Server Procedure from Oracle Forms

    Hi,
    I have Forms6i and need to create a form that execute a procedure in a SQL Server Database. This procedure inserts records retrieves from our Oracle Database (i passed the fields as parameters of the SQL Server procedure).
    What did i need to do to achieve this task.-
    Thanks in advance.-

    See
    http://www.oracle.com/technology/products/forms/pdf/275201.pdf
    Also search the forum and you will find discussions on this topic.
    Message was edited by:
    Mark Roberts

  • Querying SQL server table from Oracle database 11g

    Hi all
    We are using oracle database 11g R2 on REL 5 and i have an SQL server database used by one of our application.
    In my Oracle database, i want to query one table in my SQL server database and to link it in a table in Oracle database to compare data.
    Is there a way like database link or something else to do this need>
    Please send a link or pots here step by step the way on how to accomplish my query.
    Thank you.

    Yes, you can set up your SQL Server as an external database link, using Oracle Heterogeneous Services with SQL Server as an ODBC connection (easier to do if your Oracle server is a Windows server, a little more tricky if your Oracle server is *nix based)
    Here's the documentation... for 11gR2
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=heterogeneous+services

Maybe you are looking for