Lessons Learned: Working with Oracle stored procedures, applications and data
SearchSQLServer.com editors
Working with both Oracle and SQL Server databases presents a variety of challenges -- precisely
why we've compiled this collection of short lessons by Kevin Kline, our resident
Monitoring/Administration expert. If you have questions about working with Oracle and SQL Server,
submit
them today.
Your Instructor: Kevin Kline, Monitoring/Administration Expert
Kline is director of SQL Server Solutions at Quest Software and president of the international
Professional Association for SQL Server (PASS). Here he
addresses the following topics:

Premium Access
Register now for unlimited access to our premium content across our network of over 70 information Technology web sites.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy
Dig Deeper
-
People who read this also read...
This was first published in September 2005
Executing an Oracle stored procedure on SQL Server
Connecting an Oracle application to SQL Server
Importing data from other databases to SQL Server
Executing an Oracle stored procedure on SQL Server
Question: Is it possible to execute an Oracle stored procedure on SQL Server? If so,
how?
Kline: Oracle uses its own dialect of SQL called PL/SQL
(procedural language extension to Structured Query Language), while SQL Server uses T-SQL
(Transact-SQL). The two have very different rules about variables, parameters, conditional
processing, error handling and so forth. So unless the Oracle stored procedure contains only ANSI
SQL statements, it won't work on SQL Server. However, Microsoft recently introduced a new tool that
aids in the migration process from Oracle to SQL Server. You should investigate the SQL Server Migration Assistant. You
should also note that moving from Oracle to SQL Server is not considered a simple point-n-click
process. It usually involves a healthy dose of planning, analysis and good ol' fashion elbow
grease.
Click
for the original question and response.
Connecting an Oracle application to SQL Server
Question: I am currently working on a project with Oracle9i Forms at the front end and
Microsoft SQL Server at the back end. What steps should I take to connect an Oracle9i Forms
application with a SQL Server database?
Kline: I can't think of an easy way off of the top of my head. There's the Oracle Transparent
Gateway. But that is certainly not an easy approach. There are also a few tools available using
Oracle's Migration Workbench.
You may also be able to connect using a JDBC driver. Check out Microsoft's JDBC
driver for SQL Server. You can also find a list of JDBC drivers at DevX.com.
Click
for the original question and response.
Importing data from other databases to SQL Server
Question: Can a stored procedure be used to import data from other types of databases and
text files to SQL Server?
Kline: Absolutely! I've written many stored procedures to import data from other servers,
usually Oracle and Access as well as from text files. When importing data from other servers,
you'll have an easier time if you set up the source server as a Linked Server (see SQL Server Books Online
for more details).
Once you've set up the Linked Server, you can write SQL statements directly against the Linked
Server. For example, you could write the statement INSERT INTO local_table…SELECT col1, col2,…
FROM linked_server.db1.dbo.foo.
When importing data from text files, simply use the BULK INSERT statement or, my preference,
call the BCP command line utility using XP_CMDSHELL within the stored procedure. It takes a little
work to get the exact XP_CMDSHELL string correct. All you have to do is encapsulate the BCP
command-line string within a parameter for XP_CMDSHELL extended stored procedure.
Click
for the original question and response.
More information from SearchSQLServer.com
Disclaimer:
Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.
Join the conversationComment
Share
Comments
Results
Contribute to the conversation