Manipulate data of a SQL SERVER 2000 database

Problem:
I need to manipulate data of a SQL SERVER 2000 database that it’s installed in a Windows
from an oracle 8.1.7 database that is installed in a red hat linux server.
This access has to be made in a procedure created in this Oracle instance.
The Solution’s Environment:
- oracle 8.1.7 database - red hat linux server - ORCL INSTANCE
- SQL SERVER 2000 version 5.0 database - Windows server - SQLSERV INSTANCE
- Oracle 8.1.7 database - windows 2000 professional server - HSDB INSTANCE
We did the following steps:
1) We installed an oracle database 8.1.7 in the windows 2000 professional.
The name of this instance is HSDB.
2) We configured the HSODBC resource in this HSDB instance so as to access the SQLSERVER database.
3) It was created a database link in the ORCL instance (LINUX) so as to access the oracle HSDB instance
4) It was created a procedure in the ORCL instance that insert data into the SQLSERVER database using the database link.
This procedure pass through the following instances:
ORCL Instance (database link) => HSDB Instance (HS Resource) => SQLSERV Instance
5) When I execute this simple procedure of the ORCL Instance, the process takes a long time. Although if I run this insert on a SQL Plus, the transaction ends fast. Why it’s happening?
PROCEDURE PRC_TESTE(P_CD_CMC7 IN VARCHAR2) IS
BEGIN
BEGIN
INSERT INTO VSolicitacaoRetirada@MSSQLDB
("CMC7")
VALUES
(P_CD_CMC7);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR '||SQLERRM);
END;
COMMIT;
END;
Tranks

I modified the PRC_TESTE procedure and worked fine when I made the following change.
In spite of using the P_CD_CMC7 parameter on the INSERT command, I included a fixed value. Althoug I can´t use this fixed value. What it can be?
Example:
CREATE OR REPLACE PROCEDURE PRC_TESTE(P_CD_CMC7 IN VARCHAR2)
IS
BEGIN
BEGIN
INSERT INTO VSolicitacaoRetirada@MSSQLDB
("CMC7")
VALUES
('123456');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERRO NO INSERT '||SQLERRM);
END;
COMMIT;
END;
------------------------------------------------------------

Similar Messages

  • Tell me how to format a date retrieved from a MS SQL Server 2000 database?

    Tell me how to format a date retrieved from an MS SQL Server 2000 database for various uses in my JSP page?

    Or if you want to use JSTL instead of a scriptlet see:
    http://forum.java.sun.com/thread.jspa?threadID=676754&tstart=0

  • SQL Server 2000 database GETDATE() default for field

    I have a SQL Server 2000 database where the createDate field
    has a default value of GETDATE() and the data type is datetime. It
    is inserting the date just fine, but I do not want to capture the
    time along with the date. I only want the date to be entered. How
    can I accomplish this? Thanks!

    IF you only wanted to store the date, then yes you would use
    that as the column default value.
    createDate datetime default convert(datetime,
    convert(varchar, getDate(), 102), 102)
    However, as paross1 cautioned be sure you understand you will
    only be capturing the date from now on. If you change your mind
    later, and decide you need both the created date and time, you will
    be seriously out of luck. A safer choice might be to keep the date
    and time, and use convert in your queries instead.

  • How to load data to a SQL Server 2000 from a text file ( fixed / delimited)

    I am a navie user to ODI, just installed some time back. And I wanted to load text data ina file ( fixed length/ delimited ) to SQL server 2000 database.
    Iam intrested to know the steps I need to take to achieve this. I mean for example first creating topology,next designer..
    Could you please provide some books/articles or any documents that talt about these steps clearly one-by-one.

    Hi,
    Oracle Data Integrator - Getting Started with an ETL Project
    follow this manuel step by step and you will be able to load data from file to any database...

  • How to insert chinese data into MS SQL Server 2000 through JDBC

    I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
    can anybody help me.
    thanx.

    I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
    can anybody help me.
    thanx.

  • Problem converting captured SQL Server 2000 database to Oracle

    Java(TM) Platform     1.6.0_17
    Oracle IDE     2.1.1.64.45
    Versioning Support     2.1.1.64.45
    After creating MWREP user, granting it privileges and creating the migration repository, I have captured a small SQL Server 2000 database (1 table), but after performing "Convert to Oracle", I get the message that it has transformed correctly, but no converted model is shown. I was originally using the JRE supplied with SQL Developer 2.1.1, but replaced that with 1.6 U17 after researching the problem here.
    The only message in the Migration Log is as follows:
    Catalog RAC, Schema dbo coalesced to single schema dbo_RAC
    The following message appears in the console:
    SELECT DISTINCT(REF_ID_FK), REF_TYPE FROM MD_ADDITIONAL_PROPERTIES WHERE PROP_KEY IN (?) AND CONNECTION_ID_FK = ?
    I have tried this with a more complex database, with no luck.
    Any thoughts?

    I did an offline capture.
    I used Tools->Migration->Third Party Database Offline Capture->Create Database Capture Scripts to generate scripts OMWB_OFFLINE_CAPTURE.BAT, SS2K_BCP_SCRIPT.BAT and sqlserver2000.ocp. Then the SQL Server DBA ran OMWB_OFFLINE_CAPTURE.BAT and sent me the output.
    I used Tools->Migration->Third Party Database Offline Capture->Load Database Capture Scripts Output to capture the model into the repository successfully.

  • How can i connect to a SQL Server 2000 database usgin JSP?

    I need (URGENT) to connect to SQL Server 2000 databse using JSP. I do not know how to program using JSP, so if anyone has any code snippet please let me see it. What i need is to give my site some login/password security.
    Anyone?
    Thx.

    just create an ODBC of your database from control pannel -> administrative tools -> data sources (ODBC) ,double click it .....
    go to the tab SYstem DSN , click on ADD button. select the driver for your connection. it will be the last one in the list "SQL Server".
    click Next then give ur DSN name there, description and Server Name , on next give your username and password of SQL server. when it will be connected to the server celect your database from there and hence there will be an ODBC bridge same as in case of MS Access.
    code for connecting to ODBC is
    // DSN-NAME same as in System DSN.
    // username and password are of your databse
    try
              url = "jdbc:odbc:DSN-NAME";
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
              connect = DriverManager.getConnection( url,"username","password" );
              catch ( ClassNotFoundException cnfex ) {
                        setErrorMsg( cnfex.getMessage() );
              catch ( SQLException sqlex ) {
                        setErrorMsg( sqlex.getMessage() );
              catch ( Exception ex ) {
                        setErrorMsg( ex.getMessage() );
    Now you are connected to the SQL Server ..... use connect object for further processing .........

  • Connecting to an SQL Server 2000 Database

    Hi!
    I am trying to make a connection to a database created from SQL Server 2000. However, I don't know how to do it. Can anyone please help? How would the Java code different from the code we use to connect to a database created from MS Access?
    jt

    Hi Hartmut,
    I have a program which inserts a date into a table.
    I use a dsn configured to a database (as you've
    suggested). In my case, it's MS Access:
    private boolean writeToMSAccess(Hashtable ht) {
        // Build sql statement;
        // we use of # around the date, for MS Access.
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";
            // Connect to the database, execute the sql.
            // dsn is passed into the program
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String url = "jdbc:odbc:" + dsn;
            Connection conn = DriverManager.getConnection(url, login, password);
            Statement  stmt = conn.createStatement();
            stmt.executeUpdate(sql);
            stmt.close();
            conn.close();
            return true;
        }Now if I point my DSN to SQL Server for example,
    it won't work b/c of the # marks. I'd have to change:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";to:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "'" + date + "', " +
            .... + "')";My question is, is there a way to detect which database
    my dsn points to, so that I can determine at run-time
    whether or not to use the # marks?
    Or is there another way around this problem?
    Any help is greatly appreciated!
    -alex

  • Which is the best way to migrate the SQL SERVER 2000 Database to SQL SERVER 2003 Database?

    Hi,
        I  need to migrate the Production database sql server 2000 to Sql server 2003, Please give me the best idea to migrate the database without any loss data, credentials and  Objects. 
    Nandha Kumar

    SQL server does not have any version named SQL server 2003 please check the version correctly it should be either SQL 2005,2008,2008 R2,2012
    You can use the backup/restore to upgrade the SQL 2000 database to till SQL 2005,2008,2008R2
    For SQL Server 2000 to 2012
    First upgrade from SQL 2000 database to either SQL 2005, 2008 or 2008R2 and than upgrade it to SQL 2012.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/eaa1eb44-729f-466b-8233-cb768fbb4208/upgrading-to-sql-server-2008-from-sql-server-2000?forum=sqlsetupandupgrade
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/4fac7511-2c75-46a0-802b-807dd26b12bf/sql-2012-will-not-convert-a-sql-2000-database?forum=sqlservermigration
    And after migration to SQL 2005 or 2008, if you want to script the database than can generate scripts pick DB and check off "script all objects in the selected database".
    http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy-database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/
    You can upgrade from SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2 to SQL Server 2012.
    http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Plz its URGENT : Storing unicode data in MS SQL Server 2000 through JSPs

    Hello All,
    I'm trying to store unicode data, entered from JSP page into the SQL Server. For that I've tried the following :
    1> I put tag -
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    2> Also set in JSP tag -
    <%@page contentType="text/html;charset=UTF-8"%>
    But, still data is being entered in ISO-8859-1 format, don't know why. I tried with function for convertion - private String toUniCode(String strPar)-it successfully shows me the unicode data in alret msg, but it doesn't enters unicode data in SQL Server. In SQL Server only '??????' get entered. I kept data-type in SQL Server as nvarchar to store data in unicode.
    Would it be possible for me, to accept the data as UTF-8 itself & can I store it in SQL Server as it is? How can I do that? I'm accepting data in 'marathi' language.
    Plz, anybody Help me, I'm trying for this from around more than 1 week.
    Thanks in advance for any replies!

    Hello dmorris800,
    Thanx for your help. In fact I've tried lot many alternatives for that. Later I realised that it was problame of Driver, not of code. I was using jdbc:odbc driver which doesn't support unicode, or I don't know what was the problame with it.
    But I downloaded the driver named :'TaveConnect30C'. It is the connection optimised driver of Atinav.com This is the JDBC3 Type 4 Driver for MS SQL Server 6.5/7.0/2000 & trial version of which can be downloaded from http://www.atinav.com/download.htm
    It is really very good type-4 Driver.
    Cheers
    -Yogesh

  • Tomcat - SQL Server 2000 Database connectivity - Need Help

    Hi
    I am new to java and Apache Tomcat, can anyone help me how to connect SQLServer 2000 Database. thru .jsp, in my pc I have installed XP Prof. with SP2, SQL Server 2000 Developer Ed. with SP4, Apache Server 2.2 Tomact 5.5., Microsoft SQL Server 2000 Driver for JDBC. Please help me out.. I want to know all settings for SQL connectivity & sample code.
    Thanks in advance.
    Bharat Gajjar

    So why don't you search for the documentation? Tomcat is one of the few apache java projects that is actually decently documented.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    That should be all you need to get up and running. For the correct JDBC settings, the microsoft website has an article, as do many other websites.
    http://msdn2.microsoft.com/en-us/library/ms378672.aspx

  • Inserting data into MS SQL server 2000/2005 - JEE application

    Hello everyone,
    Looking at the Tutorial, roster, under ejb, it uses EntityManager and persistence to insert and access data from the, what i presume the Java DB. So i tried it with my applications. I get no errors when I insert the data. Only that it is not going into the DB, which is an external database, MS SQL server. Does this mean I can only insert and access data from the database through sql statements?
    Help!
    Thanks
    eve

    Hello everyone,
    I have made progress on this. And if anyone requires more details check this website:
    http://www.webagesolutions.com/knowledgebase/javakb/jkb006/index.html
    Also please check your firewalls when dealing with external DB. For example, the windows firewall blocks the server from access MS server DB. So in an actual of fact, my above problem was working, only that it was probably directing data to the Java DB included in the application server 9.
    The progress so far, is good. The persistence xml seems to create the Tables into the database. But it does not enter data into the database. Below is the error I get:
    java.lang.ClassCastException: com.sun.gjc.spi.DataSource
    at productinfor.AppClientMachines$saveListener.actionPerformed(AppClientMachines.java:138)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5501)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5266)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3968)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Aslo the error is point to this in my client:
    Machinesbean sebean=(Machinesbean)ctx.lookup("jdbc/ProductDetailsDB");
    And below is the xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="PRODUCTINFOR-ejbPU" transaction-type="JTA">
    <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
    <jta-data-source>jdbc/ProductDetailsDB</jta-data-source>
    <properties>
    <property name="toplink.ddl-generation" value="create-tables"/>
    </properties>
    </persistence-unit>
    </persistence>
    Somebody also suggestion I make my persistence xml file as follows to use MS server 2000/2005:
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
    <persistence-unit name="PRODUCTDETAILS3-ejbPU">
    <jta-data-source>jdbc/ProductDetailsDB</jta-data-source>
    <properties>
    <!--Use the java2db feature -->
    <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
    <!-- Generate the sql specific to MS SQL database -->
    <property name="toplink.platform.class.name"
    value="oracle.toplink.essentials.platform.database.SQLServerPlatform"/>
    </properties>
    </persistence-unit>
    </persistence>
    Any suggestions will help. If not I hope this helps somebody else. Thanks for all your help
    eve
    Message was edited by:
    evepokua

  • Error migrating SQL Server 2000 database to Oracle.

    Hi,
    I am new in SQL Developer.
    I read most of the help manuals available on the net.
    I am able to create connections to both SQL Server and Oracle database.
    I am also able to create the migration repository on the Oracle database.
    SQL server connection - TestSQL
    Oracle database connection - TestOracle
    Migration Repository - Migration_Repository.
    Here is the problem am facing:
    When I start Migrate to Oracle wizard, by right clicking the TestSQL database, I followed all the required steps and enter the necessary information. -
    It starts creating the project - say, TEST but after that it gave the following error:
    Migration actions have failed. Check the migration report for more details. : ORA-01400: cannot insert null into ("MIGRATIONS"."MD_PROJECT_ID").
    Please help.

    Thanks for your reply.
    You are correct, there were some permission missing on the migration repository user.
    I have given permissions and it worked fine.
    but I can say that required permission mentioned in other posts and blogs on the Internet are not sufficient.
    One has to provide more admin priviligies to this user.

  • Retrieving Image Data Type from SQL Server 2000

    I'm trying to retrieve an Image using getBinaryStream() like descripbed in below code and encounter an error :
    java.lang.ClassCastException: com.microsoft.jdbc.base.BaseInputStreamWrapper
    What've I done wrong? Please help
    if(rs.next()){
                        fisAssyChart = (FileInputStream)rs.getBinaryStream("file_assembly_chat");
                        fisPPO = (FileInputStream)rs.getBinaryStream("file_ppo");
                        filePPO = new File(rs.getString("nama_file_ppo"));                    
                        fileAssyChart = new File(rs.getString("nama_file_assembly_chat"));                                                            
                   }Thx in advance
    David

    Oracle Migration Workbench:
    http://www.oracle.com/technology/tech/migration/workbench/index.html
    Cheers, OTN

  • Error while connecting to SQL Server 2000 using Heteregenous Services 11g

    Hope this is the right thread to post on! We have been given the challenge of connecting to and reading data from a SQL Server 2000 database.
    Our Infrastructure guys have set up the network access.
    The SQL Server DB is set to windows NT Authentication only (N.B. NOT Mixed Mode) as there is an application running against the DB locally that will not run under Mixed Mode.
    Our Oracle partner has download and installed the 11g Heteregenous Services. all works fine until the point we try to create the DBLink and then connect to the SQL Server DB when we get:
    SQL> CREATE DATABASE LINK infoteam1.sco.infoteam.co.uk CONNECT TO "sco.infoteam.co.uk/infoteam" IDENTIFIED BY "########" USING 'dg4msql';
    Database link created.
    SQL> select * from "systables"@infoteam1.sco.infoteam.co.uk;
    select * from "systables"@infoteam1.sco.infoteam.co.uk
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Oracle][ODBC SQL Server Driver][SQL Server]Login failed for user
    'sco.infoteam.co.uk/infoteam'. Reason: Not associated with a trusted SQL Server
    connection.[Oracle][ODBC SQL Server Driver]Invalid connection string attribute
    ORA-02063: preceding 2 lines from INFOTEAM1.SCO.INFOTEAM.CO.UK
    The question is can we (and if so how)?) connect to the SQL Server using an NT Windows Authorised account?
    Jeremy

    Hi,
    Please look at MOS note
    ORA-28500: Generic connectivity using ODBC DSN over mapped drive fails [ID 105210.1]
    Ora-28500 with Ms Sqlserver - Not associated with a trusted SQL Server connection [ID 333775.1]
    Regards,
    Edited by: gjilevski1 on Aug 31, 2010 8:23 AM

Maybe you are looking for

  • Menu Bar issues on Macbook Pro

    I came across this problem with my mac where after logging in I noticed that the menu bar, specifically the battery and wifi icon takes atleast 5-10 mins to appear and when I hover the cursor anywhere on the right side of the menu bar it shows the sp

  • I was prompted to update my apple tv. That was two hours ago and its still preparing update. How long does it take!

    How long does it take to update Apple Tv.  Its been more then two hours and its only in step 1 of 2?

  • Service item should not post to stock

    Dear Experts, I have the following scenario. I have a service material (DIEN). And created a PO with Account assignment M with SO. I have done the GR, accounting entries are posted as: + KBS --> CoGS - WRX --> GR/IR Clearing Account entries are corre

  • Ink showing finished after replacing

    I replaced the black ink and it still shows ink error. It printed but now doesn't want to print anymore. Can one print only with a black ink cartridge? I have a colour ink cartridge but don't print in colour. How do i stop the test page printing and

  • There was an error connecting to the network, try again!

    I bought a new Computer (Mac Mini) with Snow Leopard installed; On joining the network(WEP128Bit) airport extremebasestation and airportexpress with WDS-mode) suddenly the basestation didnt offer WEP 128bit any more. I cant remember precisely but i t