How to convert SQL to PL/ORACLE
Hi All,
I have the MSSQL SQL statement as below:
select column_name
from information_schema.key_column_usage
where constraint_name in ( select constraint_name
from information_schema.table_constraints
where table_name = 'cppuUTMSTATS' and constraint_type = 'PRIMARY KEY' )
order by ordinal_position;
I would like to have the equivalent PL statement for ORACLE.
Please help.
Thanks,
JP
The only possible problem I see is that you're trying
to order with a non selected column, you need that
the order by column is in the select to make it
work.Really?
SQL> select ename, job
2 from emp
3 order by empno
4 ;
ENAME JOB
SMITH CLERK
ALLEN SALESMAN
WARD SALESMAN
JONES MANAGER
MARTIN SALESMAN
BLAKE MANAGER
CLARK MANAGER
SCOTT ANALYST
KING PRESIDENT
TURNER SALESMAN
ADAMS CLERK
JAMES CLERK
FORD ANALYST
MILLER CLERK
14 rows selected.
SQL>I don't have a problem with ordering by columns that aren't selected.
Similar Messages
-
How to convert sql query to oracle query?
Hi all,
Hope doing well,
sir i am using oracle database where i am running my sql query in oracle. but this query is not working properly. i used sql developer translation scratch editor to convert that.
it's converted but i am not getting the exact value.
which i was getting in sql server.
here is my query below:
SELECT C.*,ISNULL(P.Comp_Name,'') + ' (' + ISNULL(P.Comp_ID,'') + ')' Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID Where C.Comp_ID='C02'
please convert it into oracle so that i can use this query
thanks in advance.Try --
1. Use NVL instead of isNull
2. Use *||* instead of +*
/* Formatted on 9-13-2012 4:39:09 PM (QP5 v5.163.1008.3004) */
SELECT c.*, NVL (p.comp_name, '') || ' (' || NVL (p.comp_id, '') || ')' parent
FROM comp_master c LEFT JOIN comp_master p ON c.parent_id = p.comp_id
WHERE c.comp_id = 'C02'
PS - Do remember to mark the solutions as Helpful or Correct. Thanks for understanding. -
How to convert SQL Server hierarchical query (CTE) to Oracle?
How to convert SQL Server hierarchical query (CTE) to Oracle?
WITH cte (col1, col2) AS
SELECT col1, col2
FROM dbo.[tb1]
WHERE col1 = 12
UNION ALL
SELECT c.col1, c.col2
FROM dbo.[tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
DELETE a
FROM dbo.[tb1] AS a INNER JOIN cte AS b
ON a.col1 = b.col1See: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2129904
Ah, just spotted it's a delete statement - you won't be able to do it using subquery factoring in Oracle.
I had a go at trying to convert for you, but notice that you reference the cte from inside the cte... I can only assume you have a table called cte too...
DELETE FROM dbo.tb1
WHERE col1 = 12
OR col2 IN (SELECT col1 FROM cte)
Edited by: Boneist on 22-Jun-2009 09:19 -
How execute pl/sql command from Oracle ADF Business Components
can't find examples for how execute pl/sql command from Oracle ADF Business Components and how call pl/sql package procedure from ADF Business Components.
insert,update,delete rows in view object instance cache is good but if i must do some complex operations while insert,update,delete rows..it's more better for me to call
pl/sql procedure from oracle db.Am i wrong ????Roman,
this should be similar to how it worked in JDeveloper 9.0.3. hava a look at <JDev903 Home>\BC4J\samples\StoredProc for a code example.
Frank -
How to convert a dedicated running oracle server to a shared server
i need help as to how to convert a dedicated running oracle server to a shared server.(step by step plz i am fairly a fresh person)
there are presently 10 users but have to configure for 125 users accessing from 5 locations.
also need how to implement connection manager125 users are not so much, unless your database server is a quite small one. Anyway, you have to configure Dispatchers and Shared Servers. See Configuring Oracle Database for Shared Server
About Connection Manager see Configuring and Administering Oracle Connection Manager -
How to migrate sql 7 to oracle 9i ???
Hi,
Plz let me know the step by step solution of how to migrate sql 7 to oracle 9i? I am using oracle 9i and i have a d'base created in sql 7 and I am using win2000 server all are on the same server.if you could provide me the links which solve my problem.
thanks a lot
wityh regards : Alok KumarHi Alok,
Oracle have a tool called the Oracle Migration Workbench (OMWB). It is a free tool which can help you migrate you database from SQL Server 7 to Oracle 9i. You can find out more about it here.
http://www.oracle.com/technology/tech/migration/workbench/index.html
You basically need to download the OMWB Core part and then 1 of the plugins (You need to download the SQL Server 7 plugin).
Once these are installed you can connect to your SQL Server 7 database, capture the schema objects within, map these to their Oracle equivalents and then Generate then into you Oracle database. Its GUI wizard driven tool so its easy enough to use.
Note that this tool helps people move there databases to Oracle and is not a silver bullet. The more complex your database more time you need to rectify problems and test.
I hope this helps,
Dermot. -
How to convert SQL server stored procedures to Oracle 11g
Hi Experts,
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
Please help me,
Thanks.ramya_162 wrote:
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
The single most fundamental concept you need to understand (grok in its fullness) is:
ORACLE IS NOT SQL-SERVER
There is very little, to NOTHING, in common between T-SQL (a language extension to SQL) and PL/SQL (integration of SQL with the language Ada, part of ALGOL family of languages that includes Pascal and C++).
So taking a T-SQL procedure and porting it as is to PL/SQL is plain stupid.
Why?
Oracle sucks at trying to be SQL-Server.
So how do you migrate from SQL-Server to Oracle?
By taking the REQUIREMENTS that the T-SQL procedures address, and addressing these requirements using Oracle SQL and PL/SQL. -
How to get .ocp file when converting sql database to oracle database?
Hi all,
Hope doing well,
sir i am using sql developer tool for migration from sql server to oracle
i am using this offline but i don't know how to create .ocp file
please help me.
it's urgent
waiting for reply.
thanks in advance.The OCP files are created during OFFLINE Migration. In SQl Developer click on Tools -> Migration -> Create Database Capture Scripts. Choose an output directory, make sure to select the correct platform (Windows) and select MS SQl Server from the drop down list.
You'll get in the directory specified earlier the batch and OCP files required to create the source model using the offline method.
Have a look at this web site: http://www.oracle.com/technetwork/products/migration/sqlserver-095136.html
It contains more info including a link to a video demonstrating the offline capture method. -
How to convert mongodb data to oracle
The requirement is I need to convert the mongodb or JSON data which is provided to us in Oracle format
so that it can be used in Oracle Data Integrator ODI
Edited by: 918554 on Aug 9, 2012 10:37 PM
Edited by: 918554 on Aug 9, 2012 11:02 PM
Kindly reply soon its urgent
Edited by: 918554 on Aug 9, 2012 11:03 PM918554 wrote:
how to convert mongodb data to oracleThis is NOT an Oracle problem or solution.
http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart -
How to execute SQL statement with oracle jdev
Please I'm a beginner in oracle jdeveloper. I want to know how to use and execute sql statememt within oracle Jdeveloper 10 g release 3 to manipulate objects in oracle database. I want for e.g. to Enable/disable trigger using sql statement "ALTER TRIGGER trigername DISABLE" explicitly. Please tell me how to proceed.
i am sure you can help me
Sincerly yours.Hi,
Using following tutorial http://www.oracle.com/technology/obe/ADF_tutorial_1013/10131/index.htm
you will found how to connect from Jdev to a database (chapter 1 or 2 ?). Then you just have to go under Tool>SQL*Plus or Tools>SQL Worksheet depending on what you need.
Luck,
Tif -
Converting SQL SERVER to Oracle
Hey everyone,
I have one thesis about database. I have a plan to making a program to convert database with sql server to Oracle Database. Anyone have made some programs that similar with mine ?? Anyone can give me some informations? Can you tell me about the concept??
Thanks everyone....aDiny wrote:
can you tell me the concept and example programs that able to do this job like that?
1. Define data in source
2. Define destination.
3. Read data from source (based on 1)
4. Map date to destination (based on 1 and 2)
5. Write data to destination (based on 2) -
How to convert sql server database to SQL Server Express LocalDB??
How do I convert sql server database 2008 to SQL Server Express LocalDB??
Thanks
AruHello,
Please read the following article:
http://msdn.microsoft.com/en-us/library/hh873188.aspx
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
How to convert sql server procedure in to plsql procedure
hi guys
i have requirement where in i have to convert sql server procedure into plsql procedure.
can some one help me out .
thanks,
Vamshi.DHi Vamshi,
As you want to convert sql server procedure in to plsql procedure
i.e SQL SERVER ->ORACLE Right
FYI
SQL SERVER Proc. Syntax are totally different as compared to ORACLE Proc.
So, better you study Logic of SQL-SERVER Proc and convert into
Oracle Procedure.
Thanks,
Samadhan -
Hello,
I use Entity Framework code first approach.
My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
But, Is this possible to access SQL Server and Oracle in the same project.
Thanks,
MuruganThis should be possible with a Code-First workflow. In Code-First the database mapping layer is generated at runtime.
David
David http://blogs.msdn.com/b/dbrowne/ -
How to convert SQL*Plus reports to SQLDeveloper?
Hello,
I installed Oracle 11g and found that SQLPLUSW.EXE was not there.
I have many scripts, reports, developed in SQLPLUS.
How can I convert my reports to run in SQL Developer and produce the same nice output?
It seems that SQLDev does not support columns formatting, TTITLE, BTITLE, BREAK, all the nice SQLPLUS stuff.
Any ideas other than installing Oracle10g and running good old SQLPLUS?
Thank you,
YGHi YG,
Based on your comments, you have either experimented a bit or read some forum posts like these:
Re: sqlplusw.exe not found
SQLPLUS commands in SQL Developer
Perhaps you could use the command line version of SQL*Plus (sqlplus.exe) which is still available in 11g and just spool the output?
Regards,
Gary Graham
SQLDeveloper Team
Maybe you are looking for
-
Lightroom 4-How to reorganize files by date when choosing to add rather than copy them to Lightroom
My photos were in disorganized folders on different hard drives. I was able to import them into Lightroom 4 using COPY, and now my folders are reorganized by year and month on my hard drive, which is how I want them. However, I now have a copy of my
-
Problem Connecting HP OfficeJet Pro 8500 a909g to Wireless Router LinkSys EA6300
Hi- Please help. I just got a new computer and am trying to set up my printer wirelessly to connect to my computer. With my old computer, I had it connected via a wired usb connection because I could not get the wireless setup to work. I would like t
-
Hi guru's In my case-->Return orders"X"and "Y" both generated credit memos based on the quantity of the return order, even though the post goods issue quantity was less. The credit memos had to be cancelled and the quantities in the return orders ch
-
Nice! Multilingual forms?
Nice work, guys. I've been evaluating this APTT for a couple of days and it's working pretty well. I'm just wondering about support for multi-lingual forms, including non-ASCII characters. There is a line in the System requirements, "While ATTP is o
-
How to know data in data moved into GL
Hi All, I have doubt could you clarify it. How can we know that data available in AP and AR is moved into into GL. If Gl_interface is going to act here. How does Gl_interface identify the data. Can you explain me. Thanks & Regards, pallis