Help me conver following SQL server script in to Oracle Script
could any one help me to conver following script in to oracle script
Create Procedure Insert_profilebasicdetail
@isubprofileid as int,
@Copyisubprofileid as int,
@itranno as int,
As
Begin
Declare @IncKeyId as int
Declare @tempkeyId as int
set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)
Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
from profilebasicdetail where isubprofileid=@Copyisubprofileid and itranno=@itranno
open TempInsert
fetch from TempInsert into @tempkeyId
while @@fetch_Status=0
Begin
set @IncKeyId = @IncKeyId + 1
Insert into profilebasicdetail
(ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
iyear,@isubprofileid from profilebasicdetail where ikeyId=@tempkeyId)
fetch next from TempInsert into @tempkeyId
End
End
Regards,
Ajay
Thanks Pavan Kumar
i m new in oracle i don't know anything.
i run following script on TOAD 9.5 n it gives me error
could u suggest me how can i run this script means directly on oracle 10g or on TOAD
if u r at india then could u give me ur mobile number so i can explain my query u clearly.
Create or Replace Procedure Insert_profilebasicdetail
p_isubprofileid IN NUMBER,
p_Copyisubprofileid IN NUMBER,
p_itranno IN NUMBER,
As
v_IncKeyID NUMBER;
v_tempkeyId NUMBER;
CURSOR TempInsert IS
SELECT ikeyid, iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
FROM profilebasicdetail
WHERE isubprofileid=p_Copyisubprofileid and itranno=p_itranno
Begin
SELECT MAX(NVL(iKeyID,0))
INTO v_IncKeyID
FROM profilebasicdetail;
FOR r in TempInsert LOOP
v_IncKeyID = v_InceyID + 1;
Insert into profilebasicdetail
(ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
values(select v_IncKeyId,r.iprofileid,r.iquestionid,r,vquestionans,
r.cstatusindi,r.dmodifyon,r.imodifyby,'1',
r.iyear,p_Copyisubprofileid
from profilebasicdetail
where ikeyId=r.ikeyId);
END LOOP;
EXCEPTION
WHEN others THEN
raise;
End;
Regards,
Ajay
Similar Messages
-
TF255186: The following SQL Server Reporting Services Instance could not be found
Hi,
I'm trying to install TFS 2013 on a remote SQL RS instance.
Using the TFS 2103 U4 installation
SQL 2012 RS, name instance, Server: SQLProdA, Instance Name COMRS
When I enabled tracing using debugView I see the following output:
[4160] [Error @11:07:10.978] Exception Message: TF255186: The following SQL Server Reporting Services Instance could not be found: COMRS. The server name is: SQLProdA. (type TfsAdminException)
Any ideas what the issue is?
Thanks,
reuvyHi Charles,
Thanks for the help. I already saw those links, and am already trying with the format. As I wrote above:
Server: SQLProdA, Instance Name COMRS
So I wrote in the box "SQLProdA\COMRS" (without quotes of course) and I still keep getting that error.
I don't know if it matters, but although this is indeed a named instance, nonetheless, the path to the report server uses the default url (ie.
http://servername/reports) as opposed to the name instance version (ie.
http://servername_instance/reports) as mentioned by your link and this post:
https://msdn.microsoft.com/en-us/library/bb552341.aspx
But, I checked with Fiddler on the server and didn't see it trying to even access the link so I don't think it is related. I saw with Process Monitor that it is indeed trying to access via the network resources on SQLProdA, so I know it's trying.
I have noticed something in the past, and wondered if this could be the issue, that for example if I have Management Studio 2014 installed, I cannot connect to a Reporting Services instance which is 2012. Only when Management Studio 2012 is installed
and being used can I connect. I wondered if this possibly could be related, that maybe the API or something else which the installer is using is missing some component to connect to the RS instance.
Just in case, I already installed both the SQL 2012 and 2014 Client Tools Connectivity (although I first installed 2014, and then 2012).
Do you think this could be the issue? If not, do you possibly have any other leads?
Thanks,
Reuvy -
I am unable to see following SQL Server Analysis Services in central admin services after the SQL 2014 power pivot installations
RaviHi Ravi,
Per my knowledge, there is no Analysis Service in SharePoint.
After running the SQL 2014 setup to install PowerPivot for SharePoint, you need to open the PowerPivot for SharePoint 2013 Configuration tool in Central Admin Server and configure PowerPivot for SharePoint.
After that, you will see new Service Application called "Default PowerPivot Service Application" in Central Administration.
If you have other WFE servers, then you need to install the PowerPivot Add-In on all the other servers in the SharePoint farm.
More references:
http://sridharbabuk.blogspot.jp/2013/02/installing-configuring-analysis-service.html
http://msdn.microsoft.com/en-us/library/jj219067.aspx
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
How to call a sql server stored procedure from oracle
Hi all,
Please anybody tell me how to call a sql server stored procedure from oracle.
I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
"dbo"."CreateReceipt"@hsa
where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
my database version is 10g
Please help me how can i call it... I need to pass some parameters too to the SP
thanking youhi,
thank you for the response.
when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
my code is,
declare
c INTEGER;
nr INTEGER;
begin
c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
end;
Create_Receipt is the sp which requires two parameters.
please give me a solution
thanking you
sreejith -
Sql Server Management Assistant (SSMA) Oracle okay for large database migrations?
All:
We don't have much experience with the SSMA (Oracle) tool and need some advice from those of you familiar with it. We must migrate an Oracle 11.2.0.3.0 database to SQL Server 2014. The Oracle database consists of approximately 25,000 tables and 30,000
views and related indices. The database is approximately 2.3 TB in size.
Is this do-able using the latest version of SSMA-Oracle? If so, how much horsepower would you throw at this to get it done?
Any other gotchas and advice appreciated.
Kindest Regards,
Bill
Bill DavidsonHi
Bill,
SSMA supports migrating large database of Oracle. To migrate Oracle database to SQL Server 2014, you could use the latest version:
Microsoft SQL Server Migration Assistant v6.0 for Oracle. Before the migration, you should pay attention to the points below.
1.The account that is used to connect to the Oracle database must have at least CONNECT permissions. This enables SSMA to obtain metadata from schemas owned by the connecting user. To obtain metadata for objects in other schemas and then convert objects
in those schemas, the account must have the following permissions: CREATE ANY PROCEDURE, EXECUTE ANY PROCEDURE, SELECT ANY TABLE, SELECT ANY SEQUENCE, CREATE ANY TYPE, CREATE ANY TRIGGER, SELECT ANY DICTIONARY.
2.Metadata about the Oracle database is not automatically refreshed. The metadata in Oracle Metadata Explorer is a snapshot of the metadata when you first connected, or the last time that you manually refreshed metadata. You can manually update metadata
for all schemas, a single schema, or individual database objects. For more information about the process, please refer to the similar article:
https://msdn.microsoft.com/en-us/library/hh313203(v=sql.110).
3.The account that is used to connect to SQL Server requires different permissions depending on the actions that the account performs as the following:
• To convert Oracle objects to Transact-SQL syntax, to update metadata from SQL Server, or to save converted syntax to scripts, the account must have permission to log on to the instance of SQL Server.
• To load database objects into SQL Server, the account must be a member of the sysadmin server role. This is required to install CLR assemblies.
• To migrate data to SQL Server, the account must be a member of the sysadmin server role. This is required to run the SQL Server Agent data migration packages.
• To run the code that is generated by SSMA, the account must have Execute permissions for all user-defined functions in the ssma_oracle schema of the target database. These functions provide equivalent functionality of Oracle system functions, and
are used by converted objects.
• If the account that is used to connect to SQL Server is to perform all migration tasks, the account must be a member of the sysadmin server role.
For more information about the process, please refer to the similar article:
https://msdn.microsoft.com/en-us/library/hh313158(v=sql.110)
4.Metadata about SQL Server databases is not automatically updated. The metadata in SQL Server Metadata Explorer is a snapshot of the metadata when you first connected to SQL Server, or the last time that you manually updated metadata. You can manually update
metadata for all databases, or for any single database or database object.
5.If the engine being used is Server Side Data Migration Engine, then, before you can migrate data, you must install the SSMA for Oracle Extension Pack and the Oracle providers on the computer that is running SSMA. The SQL Server Agent service must also
be running. For more information about how to install the extension pack, see Installing Server Components (OracleToSQL). And when SQL Express edition is used as the target database, only client side data migration is allowed and server side data migration
is not supported. For more information about the process, please refer to the similar article:
https://msdn.microsoft.com/en-us/library/hh313202(v=sql.110)
For how to migrate Oracle Databases to SQL Server, please refer to the similar article:
https://msdn.microsoft.com/en-us/library/hh313159(v=sql.110).aspx
Regards,
Michelle Li -
Migrating from MS SQL Server 2005 database to Oracle 10g
Hello,
I wanted the full procedure or steps to Migrate the MS SQL Server 2005 database to Oracle 10g. Is there a known procedure to do this or is there a tool which is used?
I have not done migration of database from MS SQL Server to Oracle. Any help is appreciated. Thanks a lot for the time.
Regards,
RPSWrong forum, go to the database forum!
cu
Andreas -
Migration from SQL Server 7.0 to Oracle 9i
Hi,
Where can i find whitepapers for migrating from SQL Server
7.0 to Oracle 9i?
Thanks in Advancehi,
Download the Oracle Migration Workbench from this site. There is
a reference guide and online help available with the SQL Server
7.0 plugin.
Also, there is a documentation link under the Oracle Migration
Workbench section.
Regards
John -
Migration SQL Server 6.5 to Oracle 8.0.5
I am migrating from SQL Server 6.5 to Oracle 8.0.5 using
migration Workbench Ver. 1.2.2. The stored procedures are not
migrated properly where temporary tables are used to store the
intermediate results of a query on SQL Server 6.5 side. I want
to look at the coding to create a temporary table with sessionid
as part of table to make it unique for the session and the user
on the oracle side using DBMS_SQL package. Any body can give me
the coding ?
nullSurendra kumar (guest) wrote:
: Oracle Migration Workbench Team wrote:
: : Surendra,
: : It seems like the workbench is trying to use 8i temporary
: tables,
: : which is the default, this option can be switched off.
: : Note that there is an option on the Procedures, Triggers and
: : Views to generate 8i temporary tables, switch this off if
you
: : want to work with 8.0 and have an additional sessionid
column.
: : This option can be set on all procedures (click on the
: procedures
: : category on the SQLServer model pane), or on a per procedure
: : basis (click on the procedure in the left hand SQLServer
model
: : pane).
: : Hope this solves your problem,
: : Turloch
: : Oracle Migration Workbench Team
: : Surendra Kumar (guest) wrote:
: : : I am migrating from SQL Server 6.5 to Oracle 8.0.5
using
: : : migration Workbench Ver. 1.2.2. The stored procedures are
: not
: : : migrated properly where temporary tables are used to store
: the
: : : intermediate results of a query on SQL Server 6.5 side. I
: want
: : : to look at the coding to create a temporary table with
: : sessionid
: : : as part of table to make it unique for the session and the
: user
: : : on the oracle side using DBMS_SQL package. Any body can
give
: me
: : : the coding ?
: : Oracle Technology Network
: : http://technet.oracle.com
I have used the correct option and the Migration Workbench is
not creating the DDL statements correctly for the creation of
table. Whatever may be the problem I want use DBMS_SQL for
creation of unique table names with session id as part of the
table name. I need a sample script to use session id as part of
table name and to vary the name of the table dynamically in
DBMS_SQL. It is not accepting the variable name for table name
in create table statement.
null -
Export data from MS sql server table to an oracle table
I need to move data from a sql server table to an oracle table and when ever the sql server table is updated it needs to automatically update the oracle table. Is there procedure to do this or do I migrate the data once and set up a trigger on the sql server table to update the oracle table? If the trigger is the answer how do I do that?
You might want to check out Oracle's heterogeneous services functionality if you haven't done so already. Here are a few links:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/majfeat.htm#sthref74
Also, consulting the Oracle streams manual may be helpful -- particularly Chapter 5.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14228/toc.htm
Perhaps someone who is more familiar with SQL Server could provide a more helpful answer. -
Migrating SQL Server 6.5 to Oracle 8
Hi,
I am currently converting some stored procedures from SQL Server 6.5 to Oracle 8 (PL/SQL). I am having trouble converting some nested sql statements such as the following to work in Oracle.
Example :
SELECT antall=COUNT(*), ulest=(SELECT ulest=COUNT(*) FROM soknad s, annonse
a WHERE a.kundeid=13817 AND s.annonseid=a.id and lest != '1') FROM soknad s,
annonse a WHERE a.kundeid=13817 AND s.annonseid=a.id
The Select is first getting a count on the two tables for a particular id, the second field in the statement has a nested select which does a similar count but has a further condition on it.
It could be done using two SELECT statements like this -
SELECT COUNT(*) AS antall
FROM soknad s, annonse a
WHERE a.kundeid = 13817
AND s.annonseid = a.id
SELECT COUNT(*)
FROM soknad s, annonse a
WHERE a.kundeid=13817
AND s.annonseid=a.id
AND lest != '1'
which may be workable but I would like to keep it as similar to the original as much as possible.
Any ideas would be great!
Thanks,
BradI have since found out subqueries in the select list are not supported by Oracle.
Brad
null -
Sql Server Reporting services with ORACLE
We are thinking of using Sql Server Reporting servicesvwith an ORACLE DB.
I will like to know the pros and cons.
Any advice would be appreciated..
Thanks alot.Hello,
You'll find many doc, examples, demos ... on OTN :
http://www.oracle.com/technology/products/reports/index.html
http://www.oracle.com/technology/documentation/reports.html
http://www.oracle.com/technology/products/reports/htdocs/search.html?cat=ALP&col=ALC&submit=Search
For the Ref Cursors :
Oracle® Reports Building Reports
10g Release 2 (10.1.2)
B13895-01
40 Building a Paper Report with REF CURSORs
Regards -
Extract the data from SQL Server and Import into Oracle
Hi,
I would like to run a daily job that will export the table data from SQL server table (it will be only one or two table) and Import back into Oracle table (it might one or two table tables).
Could you please guide me that how can i do this using either sql server or oracle?
We have oracle 9.2 and sql server 2005.
Normally i do from flat file which is generated by source destination nand i dump into oracle using sql*loader but this time I have to directly extract/export the data from MS Sql server and load into Oracle table, mostly it will reload so i might doing any massaging data during the load.
If you show me the detail approach, it will be really appreciated.
I have access to Sql server but i don't how to use sql server to do this or using oracle as a daily job even becuase have to schedule the job for this as it will be a daily job.
Thanks,
poratipsUnless you can find an open source ODBC driver for SQL Server that runs on Solaris (and I wouldn't be overly hopeful there) Heterogeneous Services would require that you license something-- a third party ODBC driver, a new Oracle instance, or an Oracle Transparent Gateway.
As I stated below, you could certainly use SQL Server's ETL tool, DTS. Oracle's ETL tools would require additional licensing since you're just on 9.2. You could also write a small application (Java or otherwise) that connected to both databases and transferred the data. If you're particularly enterprising, you could load the SQL Server Type 4 JDBC driver into Oracle's JVM and write a Java stored procedure that connected to the SQL Server database via JDBC, but that's a pretty convoluted approach.
Justin -
Migration from sql server 2005 tables to oracle tables.
Hi,
Kindly give the steps to migrate from sql server 2005 tables to oracle tables.
Kindly advise
Oracle database version:
Oracle Database 10g Release 10.2.0.1.0 - Production
PL/SQL Release 10.2.0.1.0 - Production
"CORE 10.2.0.1.0 Production"
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Edited by: 873127 on Jul 18, 2011 9:46 PMAre you migrating or taking continual updates?
If migrating it might be worth considering The SQLDeveloper Migration Workbench (which moves more than just data)..
http://www.oracle.com/technetwork/database/migration/sqldevmigrationworkbench-132899.pdf
Cheers
David -
Replication SQL Server 7 Database to Oracle 9i
Hi -
I'm new to Database Replication, what are the steps for database replication from a MS SQL Server 7 database to Oracle 9i? Eventually this SQL Server Database will be going to SQL Server 2000 are the steps different, if so what are they?
Thanks
MuchI do not what you mean with Replicate between SQL Server and Oracle. Perhaps you mean migrate from SQL Server to Oracle or to stablish a transparent gateway.
I am going to give you this reference:
Migration Workbench Reference Guide for Microsoft SQL Server and Sybase Adaptive Server Migrations Contents / Search / Index / PDF
Heterogeneous Connectivity Administrator's Guide Contents / Search / Index / PDF
http://otn.oracle.com/pls/db92/db92.docindex?remark=homepage
Joel P�rez -
Migrating MS SQL Server 7.0 TO Oracle 8.1.5
Hello,
We are currently using Win NT 4.0, MS SQL Server with a PVCS Tracker 6.0 from Merant and will be upgrading to PVCS Dimension 6.0 from Merant.
The Dimension 6.0 product runs on Win NT 4.0, uses Oracle Server 8.1.5 with Oracle 8 ODBC Driver 2.5.3.1.0
I need to migrate MS SQL Server 7.0 To Oracle 8.1.5. Do you have a migration procedure available?
Thanks!
TP<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Oracle Migration Workbench Team:
The Oracle Migration Workbench will assist you in the Migration of the SQL*Server 7 DB. It is available as a free download from this site.
<HR></BLOCKQUOTE>
null
Maybe you are looking for
-
Hi, I am installing Oracle Identity Federation in that i am getting following issue while configuring the tools in Oracle Identity Management Suite 11.1.1.2.0. "Error Starting Managed Server wls_oif1. Cause: An internal error has occured : Managed Se
-
Xbox 360 trade in for Xbox 720
I recently purchased an Xbox 360 from the Paramus, NJ store. I was told by the sales associate that a new Xbox 720 should be on the market at some point in the next couple of years. He suggested that I purchase the Best Buy extended warranty because
-
I need to install windows 7 on my iMac (via bootcamp), should i stall 32-bit or 64-bit option? Thanks
-
Export Table Output and Print Output differing
I am trying to:- export a table to excel. print the table data. The output of the export and print are differing,the print does not capture the commandlink. The segment that I am using is :- <af:group> <af:commandToolbarButton text="Export" immediate
-
Sales order status in VKM1 transaction
Dears, How the status get's updated in teh VKM1 transaction? It get's updated from the internal table VBKRED-CSTAT. Why i am asking this question is i didn't get any clue for the status ' Reserve'. What is the meaning of the status 'Reserve'? Thanks