Convert a SQL Server Update Statement for Oracle
Hi,
i need to convert an update statement written for SQL Server to make it work on Oracle,
the update is the following:
UPDATE TABLE1
SET CDate = TBL2.CDate
FROM TABLE1 TBL1
JOIN TABLE2 TBL2 ON TBL2.Code = TBL1.TBL2Code
JOIN TABLE3 TBL3 ON TBL3.Id = TBL1.Id
WHERE TBL3.TypeCode = '07'
how can i make it compatible with oracle?
thanks!!
Billy Verreynne wrote:
Karthick_Arp wrote:
Try this
<snipped>Dislike such an approach that requires multiple hits on the same tables. This is never scalable. A key performance issue is to do only one pass through a data set when possible and not do multiple passes.Yes i understand. But to do a update on a join the table must be a Key Preserved Table. And for a normal Update it is necessory to have an EXISTS clause so that we dont update the non-matching rows to NULL.
Similar Messages
-
Converting MS Sql server stored proc to Oracle stored procedure
I need to convert this MS SQL Server 200 stored procedure to Oracle stored procedure. Any help great appreciated.
Thank you,
set nocount on
declare @sp varchar(100)
set @sp = '<< stored procedure name goes here >>'
declare @oid int
select @oid = o.id from sysobjects o where o.name = @sp
declare @last int
-- function signature
select @last = max(c.colid)
from dbo.syscolumns c
where c.id = @oid
select case c.colid
when 1 then '[ SqlCommandMethod(CommandType.StoredProcedure) ]'
+ char(13) +
'public static SqlCommand ' + @sp + '(' + char(13) +
' [ NonCommandParameter ] SqlConnection
' connection '
+ char(13) +
else ''
end
+ ' ' +
case t.name
when 'char' then
'[ SqlParameter(' + convert(nvarchar(10), c.length) + ') '
when 'varchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length) + ') ] '
when 'nchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
when 'nvarchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
else ''
end
+
case t.name
when 'char' then 'string'
when 'nchar' then 'string'
when 'varchar' then 'string'
when 'nvarchar' then 'string'
when 'bit' then 'bool'
when 'datetime' then 'DateTime'
when 'float' then 'double'
when 'real' then 'float'
when 'int' then 'int'
else 'object /* ' + t.name + ' */'
end
+ ' ' + lower(substring(c.name, 2, 1)) + substring(c.name, 3, 100)
+
case c.colid
when @last then ')' + char(13) + '{'
else ','
end
from dbo.syscolumns c
left outer join dbo.systypes t on c.xusertype = t.xusertype
where c.id = @oid
order by c.colid
-- call to generator
select case c.colid
when 1 then
' return SqlCommandGenerator.GenerateCommand(connection,' +
char(13)
else ''
end
+ ' ' + lower(substring(c.name, 2, 1)) + substring(c.name,
3, 100)
+
case c.colid
when @last then ');' + char(13) + '}'
else ','
end
from dbo.syscolumns c
where c.id = @oid
order by c.colidIt would have helped if you had posted your code.
To create tables in procedures, you can use EXECUTE IMMEDIATE. For example, if within a procedure, you want to:
CREATE TABLE table_name
(column1 NUMBER,
column2 VARCHAR2 (30),
column3 DATE);
Then, from within a procedure you can:
CREATE OR REPLACE PROCEDURE procedure_name
AS
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE table_name
(column1 NUMBER,
column2 VARCHAR2 (30),
column3 DATE)';
END procedure_name;
EXEC procedure_name
For the procedure to count the number of business days between two input dates, see the following link:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:91212348059 -
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. -
Problem : SQL Server Delete Statement vs Oracle Delete Statement
Hi,
I am currently involved in a SQL Server - Oracle Migration effort and I have hit a roadblock on one of the queries.
I have created two tables named DUMMY and DUMMY1 in MSDE with the same structure :-
CREATE TABLE DUMMY
CLIENT_ID INT,
NME VARCHAR(80),
BATCH_ID INT,
CATALOG_NAME VARCHAR(50),
DATA_SOURCE VARCHAR(50)
GOI have a DELETE statement that deletes from the two tables, by selecting common data using Joins:-
DELETE DUMMY
FROM DUMMY src
JOIN
DUMMY1 dst
ON
src.batch_id = dst.batch_id
AND src.catalog_name = dst.catalog_name
AND src.data_source = dst.data_source
WHERE
src.batch_id = 1
AND src.catalog_name = '1'
AND src.data_source = '1'Now, I have created the same Tables ( DUMMY and DUMMY1 ) in Oracle :-
CREATE TABLE DUMMY
CLIENT_ID NUMBER(5),
NME VARCHAR2(80),
BATCH_ID NUMBER(10),
CATALOG_NAME VARCHAR2(50),
DATA_SOURCE VARCHAR2(50)
)I have written a Delete statement to mimic the fucntionality in this manner :-
DELETE FROM
DUMMY
WHERE
client_id,
nme,
batch_id,
catalog_name,
data_source
IN
SELECT *
FROM
DUMMY src
JOIN
DUMMY1 dst
ON
src.batch_id = dst.batch_id
AND src.catalog_name = dst.catalog_name
AND src.data_source = dst.data_source
WHERE
src.batch_id = 1
AND src.catalog_name= '1'
AND src.data_source = '1'
)However, I keep getting this error whe I try to test it :-
ORA-06550: line 1, column 89:
PL/SQL: ORA-00913: too many values
Can you please help me modify the query to simulate the same functionality as the orignial SQL Server Query ?
Thanks,
SandeepThere is probably a mismatch between the number of columns.
Try this * Not Tested *
DELETE FROM
DUMMY
WHERE
client_id,
nme,
batch_id,
catalog_name,
data_source
IN
SELECT src.client_id,
src.nme,
src.batch_id,
src.catalog_name,
src.data_source
FROM
DUMMY src
JOIN
DUMMY1 dst
ON
src.batch_id = dst.batch_id
AND src.catalog_name = dst.catalog_name
AND src.data_source = dst.data_source
WHERE
src.batch_id = 1
AND src.catalog_name= '1'
AND src.data_source = '1'
); -
Error converting SQL Server text field to Oracle CLOB
I am trying to convert an SQL Server DB to Oracle DB using DB link. The issue I am facing is one of the SQL Server table contains text field and we are trying to convert the text field to CLOB.
The error I am getting is "SQL Error: ORA-00997: illegal use of LONG datatype"
The statement is something like this.
Insert into oracle_table
Select col_1,col_2,col_3,col_4,col_5 from sql_table@sqldblink;
Please help.Hi,
This is a known restriction involving long columns -
(1) LONG datatype not supported with use of DBLINK when insert or update involves a select statement
(2) LONG datatype cannot be used in a WHERE clause, in INSERT into ... SELECT ... FROM
constructs, and in snapshots.
The workround is to use a PL/SQL procedure or try the SQLPLUS COPY command.
If you have access to My Oracle Support then review these notes -
Cannot Move A Long From non Oracle database Ora-00997: Illegal Use Of Long Datatype (Doc ID 1246594.1)
How To Workaround Error: Ora-00997: Illegal Use Of Long Datatype (Doc ID 361716.1)
Regards,
Mike -
Converting SQL Server Stored Procedure to Oracle
Hi there,
I tried to use SwisSQL to convert my SQL Server stored procedure to Orcale without much success.
Is there anyone who could help me out with this?
My SQL Server Stored Procedure is:
CREATE PROCEDURE [dbo].[SP_BackgroundCheckRequest]
--MASTER Table
@MASTER_ID int,
@PERSONNEL_ID int = NULL,
@DATE_OF_BIRTH datetime = NULL,
@GENDER varchar(1) = NULL,
@COUNTRY_OF_BIRTH varchar(3) = NULL,
@TOWN_OF_BIRTH varchar(100) = NULL,
@STATE_OF_BIRTH varchar(50) = NULL,
@CHECK_CATEGORY varchar(10) = NULL,
@CHECK_TYPE varchar(10) = NULL,
@PRIORITY varchar(10) = NULL,
@PRIORITY_REASON varchar(100) = NULL,
@SCREENING_LEVEL nchar(1) = NULL,
@POSITION nchar(50) = NULL,
@REQUEST_SOURCE varchar(60) = NULL,
--NAME_TYPE Table
@NAME_TYPE varchar(5) = NULL,
@FAMILY_NAME varchar(50) = NULL,
@FIRST_NAME varchar(50) = NULL,
@MIDDLE_NAME varchar(50) = NULL,
@TITLE varchar(10) = NULL,
@PREFFERED_NAME varchar(40) = NULL,
@PREVIOUS_NAME varchar(140) = NULL,
--ADDRESS_TYPE Table
@ADDRESS_TYPE varchar(10) = NULL,
@ADDRESS_LINE_1 varchar(30) = NULL,
@ADDRESS_LINE_2 varchar(30) = NULL,
@ADDRESS_LINE_3 varchar(30) = NULL,
@COUNTRY varchar(3) = NULL,
@SUBURB varchar(50) = NULL,
@STATE varchar(50) = NULL,
@POSTCODE varchar(15) = NULL,
@START_DATE varchar(10) = NULL,
@END_DATE varchar(10) = NULL,
--LICENSE_TYPE Table
@LICENSE_TYPE varchar(5) = NULL,
@LICENSE_AGENCY varchar(15) = NULL,
@LICENSE_NUMBER varchar(100) = NULL,
@LICENSE_SIGHTED varchar(1) = NULL,
--PHONE_TYPE Table
@TELEPHONE_TYPE varchar(5) = NULL,
@TELEPHONE_NUMBER varchar(20) = NULL,
@MOBILE_TYPE varchar(5) = NULL,
@MOBILE_NUMBER varchar(20) = NULL,
@EXTENSION_TYPE varchar(5) = NULL,
@EXTENSION_NUMBER varchar(20) = NULL,
--PASSPORT_TYPE Table
@PASSPORT_TYPE varchar(5) = NULL,
@PASSPORT_NUMBER varchar(50) = NULL,
@PASSPORT_COUNTRY varchar(3) = NULL,
@PASSPORT_SIGHTED varchar(1) = NULL
AS
BEGIN TRANSACTION
INSERT into MASTER (MASTER_ID, PERSONNEL_ID, DATE_OF_BIRTH, GENDER, COUNTRY_OF_BIRTH,
TOWN_OF_BIRTH, STATE_OF_BIRTH, CHECK_CATEGORY, CHECK_TYPE, PRIORITY, PRIORITY_REASON,
SCREENING_LEVEL, POSITION, REQUEST_SOURCE)
VALUES (@MASTER_ID, @PERSONNEL_ID, @DATE_OF_BIRTH, @GENDER, @COUNTRY_OF_BIRTH,
@TOWN_OF_BIRTH, @STATE_OF_BIRTH, @CHECK_CATEGORY, @CHECK_TYPE, @PRIORITY, @PRIORITY_REASON,
@SCREENING_LEVEL, @POSITION, @REQUEST_SOURCE)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting values into MASTER table!', 16, 1)
RETURN
END
INSERT into NAME_TYPE (MASTER_ID,NAME_TYPE,FAMILY_NAME,FIRST_NAME,MIDDLE_NAME,TITLE)
VALUES (@MASTER_ID,@NAME_TYPE,@FAMILY_NAME,@FIRST_NAME,@MIDDLE_NAME,@TITLE)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting values into NAME_TYPE table!', 16, 1)
RETURN
END
INSERT into ADDRESS_TYPE (MASTER_ID,TYPE,ADDRESS_LINE_1,ADDRESS_LINE_2,ADDRESS_LINE_3,
COUNTRY,SUBURB,STATE,POSTCODE,START_DATE,END_DATE)
VALUES (@MASTER_ID,@ADDRESS_TYPE,@ADDRESS_LINE_1,@ADDRESS_LINE_2,@ADDRESS_LINE_3,
@COUNTRY,@SUBURB,@STATE,@POSTCODE,@START_DATE,@END_DATE)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting values into ADDRESS_TYPE table!', 16, 1)
RETURN
END
INSERT into LICENSE_TYPE (MASTER_ID,TYPE,AGENCY,NUMBER,SIGHTED_YN)
VALUES (@MASTER_ID,@LICENSE_TYPE,@LICENSE_AGENCY,@LICENSE_NUMBER,@LICENSE_SIGHTED)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting values into LICENSE_TYPE table!', 16, 1)
RETURN
END
INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
VALUES (@MASTER_ID,@TELEPHONE_TYPE,@TELEPHONE_NUMBER)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting Telephone number into PHONE_TYPE table!', 16, 1)
RETURN
END
IF ((@MOBILE_TYPE <> NULL) AND (@MOBILE_NUMBER <> NULL))
BEGIN
INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
VALUES (@MASTER_ID,@MOBILE_TYPE,@MOBILE_NUMBER)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting Mobile number into PHONE_TYPE table!', 16, 1)
RETURN
END
END
IF ((@EXTENSION_TYPE <> NULL) AND (@EXTENSION_NUMBER <> NULL))
BEGIN
INSERT into PHONE_TYPE (MASTER_ID,TYPE,NUMBER)
VALUES (@MASTER_ID,@EXTENSION_TYPE,@EXTENSION_NUMBER)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting Extension number into PHONE_TYPE table!', 16, 1)
RETURN
END
END
INSERT into PASSPORT_TYPE (MASTER_ID,NUMBER,COUNTRY,SIGHTED_YN)
VALUES (@MASTER_ID,@PASSPORT_NUMBER,@PASSPORT_COUNTRY,@PASSPORT_SIGHTED)
IF @@ERROR <> 0
BEGIN
ROLLBACK
RAISERROR ('Error inserting values into PASSPORT_TYPE table!', 16, 1)
RETURN
END
COMMITFirst, a basic concept. That also illustrates how different Oracle is (and PL/SQL) from SQL-Server (and T-SQL).
PL/SQL integrates two different languages. The PL language. The SQL language. It allows you to code SQL source code natively inside the PL language. The PL compiler is clever enough to do the rest - make calls to the SQL engine to create SQL cursors, bind PL variable values to bind variables in the SQL code. Etc.
PL is a "proper" programming language. It is much like Pascal (it is based on Ada, a close family member of Pascal). It is nothing at all like T-SQL.
Okay, now for the very basic rule for Oracle development.
Maximize SQL. This means using the SQL language to crunch data. It is the "closest" to the data. It is designed and optimised for dealing with data. Do your data processing using SQL.
Minimize PL/SQL. This means using the PL language not to crunch data, but to provide the conditional logic. Implement business rules. And then have the SQL language crunch the data as the data processing language.
Attempting to directly translate T-SQL code into PL/SQL is flawed. It is like trying to make coffee with teabags. Yeah, the tea may have caffeine it, but it is not coffee.
To do what that T-SQL script does, insert a row into a table, a typical PL/SQL equivalent will look as follows:
create or replace procedure InsertMaster( masterRow master%rowtype ) authid definer is
.. types and variables declared here
begin
-- masterRow is a record structure that matches the actual MASTER table
.. apply business rules and validation to the data.. raising user exceptions as needed
-- e.g. the POSITION column must be upper case
masterRow.position := upper(masterRow.position);
-- after the business logic and data validation we can add the row to the table
-- (PL will make the INSERT call to the SQL engine)
insert into master values masterRow;
end;No commit. The caller does the business transaction. It needs to decide when to commit to maintain the integrity of the data in the database. It may need to do several more calls, before committing.
With this approach, we can give the application schema (the caller) execute privs on this procedure. This procedure is defined with definer rights. This means it runs with the privs of owner of that procedure and MASTER table. It is trusted code. It does all the correct stuff to add a valid and checked row to the MASTER table. So we give the app schema execute privs on the procedure and no insert priv on the MASTER table.
The only way the caller can add row to the MASTER table is via this trusted procedure of ours.
And this is a typical approach in Oracle - using the PL/SQL (both PL language and SQL language) code to create an interface to a logical database in Oracle. Abstracting the complexities of SQL from the caller. Moving business and validation into PL. Allowing us the flexibility of modifying business and validation logic, without touching a single byte of caller/client code. Allowing us to manage and tune SQL performance without dealing with (badly designed and coded) SQL from a client - as the SQL resides in PL/SQL packages and procedures and functions. -
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 -
Hi,
We have exadata x3-2. I am seeing this error in alert log file frequently.
The db version: 11.2.0.3 On RAC on Linux 5.8 x86-64Bit
Errors in file /d01/oracle/TEST/11.2.0/admin/TEST1_dbtest/diag/rdbms/prod/TEST1/trace/TEST1_reco_11909.trc:
ORA-01017: invalid username/password; logon denied
[Oracle][ODBC SQL Server Wire Protocol driver][SQL Server]Login failed for user 'RECOVER'. {28000,NativeErr = 18456}
ORA-02063: preceding 2 lines from HIS_CUST
The file /d01/oracle/TEST/11.2.0/admin/TEST1_dbtest/diag/rdbms/prod/TEST1/trace/TEST1_reco_11909.trc
Contains many repeated lines like below
*** 2015-01-21 06:34:40.209
ERROR, tran=21.24.51311, session#=1, ose=0:
ORA-01017: invalid username/password; logon denied
[Oracle][ODBC SQL Server Wire Protocol driver][SQL Server]Login failed for user 'RECOVER'. {28000,NativeErr = 18456}
ORA-02063: preceding 2 lines from HIS_CUST
Could any please help why is this happening.
ThanksHi,
You have customers who are running distributed transactions using a gateway which need to be rolled back. However, the gateway has not been correctly configured for distributed transactions. To roll back a transaction on the SQL*Server database a connection is made as the user defined in the parameter HS_FDS_RECOVERY_ACCOUNT in the gateway init<sid>.ora file but this user has not been created in the SQL*Server database with the password defined in HS_FDS_RECOVERY_PWD. This user also needs to own the transaction log table.
I assume you are using the Database Gateway for SQL*Server (DG4MSQL) as the Database Gateway for ODBC (DG4ODBC) doesn't support distributed transaction.
If you have access to My Oracle Support have a look at this note -
How to Setup DG4MSQL to Use Distributed Transactions (Doc ID 227011.1)
Otherwise, check the Gateway documentation.
Regards,
Mike -
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 -
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 -
I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all
gave same error. I browsed msdn blog. But nothing help me out.
Below is the error log details--
Overall summary:
Final result: Failed: see details below
Exit code (Decimal): -2061893606
Start time: 2013-10-21 12:58:05
End time: 2013-10-21 13:52:30
Requested action: Install
Setup completed with required actions for features.
Troubleshooting information for those features:
Next step for RS: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Next step for SQLEngine: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Next step for DQ: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Next step for FullText: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Next step for Replication: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Machine Properties:
Machine name: CROY-TOSH
Machine processor count: 4
OS version: Windows 7
OS service pack: Service Pack 1
OS region: United States
OS language: English (United States)
OS architecture: x64
Process architecture: 64 Bit
OS clustered: No
Product features discovered:
Product Instance Instance ID Feature
Language Edition Version Clustered
Package properties:
Description: Microsoft SQL Server 2012 Service Pack 1
ProductName: SQL Server 2012
Type: RTM
Version: 11
SPLevel: 0
Installation location: C:\Users\CRoy\Downloads\SQL Server 2012 Developer Edition (x86 and x64) - DVD (English)\x64\setup\
Installation edition: Developer
Product Update Status:
None discovered.
User Input Settings:
ACTION: Install
ADDCURRENTUSERASSQLADMIN: false
AGTSVCACCOUNT: NT Service\SQLSERVERAGENT
AGTSVCPASSWORD: *****
AGTSVCSTARTUPTYPE: Manual
ASBACKUPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Backup
ASCOLLATION: Latin1_General_CI_AI
ASCONFIGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Config
ASDATADIR: C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data
ASLOGDIR: C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Log
ASPROVIDERMSOLAP: 1
ASSERVERMODE: MULTIDIMENSIONAL
ASSVCACCOUNT: NT Service\MSSQLServerOLAPService
ASSVCPASSWORD: <empty>
ASSVCSTARTUPTYPE: Automatic
ASSYSADMINACCOUNTS: CRoy-TOSH\CRoy
ASTEMPDIR: C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Temp
BROWSERSVCSTARTUPTYPE: Disabled
CLTCTLRNAME: ROY
CLTRESULTDIR: C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\ResultDir\
CLTSTARTUPTYPE: Manual
CLTSVCACCOUNT: NT Service\SQL Server Distributed Replay Client
CLTSVCPASSWORD: <empty>
CLTWORKINGDIR: C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\WorkingDir\
COMMFABRICENCRYPTION: 0
COMMFABRICNETWORKLEVEL: 0
COMMFABRICPORT: 0
CONFIGURATIONFILE: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
CTLRSTARTUPTYPE: Manual
CTLRSVCACCOUNT: NT Service\SQL Server Distributed Replay Controller
CTLRSVCPASSWORD: <empty>
CTLRUSERS: CRoy-TOSH\CRoy
ENABLERANU: false
ENU: true
ERRORREPORTING: true
FEATURES: SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP, RS_SHPWFE, DQC, BIDS, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, DREPLAY_CTLR, DREPLAY_CLT, SNAC_SDK, MDS
FILESTREAMLEVEL: 2
FILESTREAMSHARENAME: MSSQLSERVER
FTSVCACCOUNT: NT Service\MSSQLFDLauncher
FTSVCPASSWORD: <empty>
HELP: false
IACCEPTSQLSERVERLICENSETERMS: false
INDICATEPROGRESS: false
INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server\
INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server\
INSTALLSQLDATADIR: <empty>
INSTANCEDIR: C:\Program Files\Microsoft SQL Server\
INSTANCEID: MSSQLSERVER
INSTANCENAME: MSSQLSERVER
ISSVCACCOUNT: NT Service\MsDtsServer110
ISSVCPASSWORD: <empty>
ISSVCSTARTUPTYPE: Automatic
MATRIXCMBRICKCOMMPORT: 0
MATRIXCMSERVERNAME: <empty>
MATRIXNAME: <empty>
NPENABLED: 0
PID: *****
QUIET: false
QUIETSIMPLE: false
ROLE: <empty>
RSINSTALLMODE: DefaultNativeMode
RSSHPINSTALLMODE: SharePointFilesOnlyMode
RSSVCACCOUNT: NT Service\ReportServer
RSSVCPASSWORD: <empty>
RSSVCSTARTUPTYPE: Automatic
SAPWD: *****
SECURITYMODE: SQL
SQLBACKUPDIR: <empty>
SQLCOLLATION: Latin1_General_CI_AI
SQLSVCACCOUNT: NT Service\MSSQLSERVER
SQLSVCPASSWORD: *****
SQLSVCSTARTUPTYPE: Automatic
SQLSYSADMINACCOUNTS: CRoy-TOSH\CRoy
SQLTEMPDBDIR: <empty>
SQLTEMPDBLOGDIR: <empty>
SQLUSERDBDIR: <empty>
SQLUSERDBLOGDIR: <empty>
SQMREPORTING: false
TCPENABLED: 0
UIMODE: Normal
UpdateEnabled: true
UpdateSource: MU
X86: false
Configuration file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
Detailed results:
Feature: Management Tools - Complete
Status: Passed
Feature: Client Tools Connectivity
Status: Passed
Feature: Client Tools SDK
Status: Passed
Feature: Client Tools Backwards Compatibility
Status: Passed
Feature: Management Tools - Basic
Status: Passed
Feature: SQL Server Data Tools
Status: Passed
Feature: Reporting Services - Native
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A001A
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A001A
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
Feature: Data Quality Services
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A001A
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
Feature: Full-Text and Semantic Extractions for Search
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A001A
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
Feature: SQL Server Replication
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 0x851A001A
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
Feature: Master Data Services
Status: Passed
Feature: Distributed Replay Client
Status: Passed
Feature: Distributed Replay Controller
Status: Passed
Feature: Integration Services
Status: Passed
Feature: Data Quality Client
Status: Passed
Feature: Analysis Services
Status: Passed
Feature: Reporting Services - SharePoint
Status: Passed
Feature: Reporting Services Add-in for SharePoint Products
Status: Passed
Feature: SQL Browser
Status: Passed
Feature: Documentation Components
Status: Passed
Feature: SQL Writer
Status: Passed
Feature: SQL Client Connectivity
Status: Passed
Feature: SQL Client Connectivity SDK
Status: Passed
Rules with failures:
Global rules:
Scenario specific rules:
Rules report file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\SystemConfigurationCheck_Report.htmHi,
This 3rd time I followed this link. But nothing new, same error.
Can you please tell me how to do follow, I cannt do the 1st step, how to change the local system to windows level account, vice-versa. It is shown mine as
Server Configuration Manager(Local)
From here I folllowed the steps ---[I cannt insert link/image :-(]
SQL 2008/R2 setup fails with "Wait on the database engine recovery handle failed"
If I right clicked on SQL Server Service, there is no option to change the account.
Hello,
Thanks for your patience,did you tried stesp mentioned in below article
http://blogs.msdn.com/b/sqljourney/archive/2012/03/16/sql-2008-r2-setup-fails-with-quot-wait-on-the-database-engine-recovery-handle-failed-quot.aspx
To resolve it, follow these steps:-
When the installation throws this error, click on OK and allow it to proceed. It will fail for Database Engine, but the SQL Server service should have
been created. Check the Services console.
If the service is present, perform the following steps:-
1. Go to SQL Server Configuration manager, right click on the SQL Server service, and change the service account (if it is local system, give
it a windows level account, and vice-versa). It might throw a WMI error but you will see the account getting updated anyway. If not, then use the Services console. Change the account for SQL Agent as well.
Use this link to change sql server service account
http://technet.microsoft.com/en-us/library/ms345578.aspx
2. Next, try to start the service. It should come online.
3. However, you will not be able to log in to the SQL Server
4. Now stop the service and start it from the command prompt using -m -c -T3608 parameters.
5. Now try logging in to the server using admin connection from sqlcmd (sqlcmd admin:<server name>\<instance name> ...)
6. Once logged in, use the sp_addsrvrolemember '<domain\username>','sysadmin'.
Also add the builtin/administrators to the sysadmin role
7. Now stop the service from the command prompt and start it from SQL Server configuration manager
You should be able to log in to the server now.
Hope this helps someone.
Please revert if it helps or even if it does not
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
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 -
Conversion from SQL Server 7.0 to Oracle 8 -- Urgent!!
Hi!
I've an urgent task of migrating data from SQL Server 7.0 to
Oracle 8 for Oracle Financials Application. When is the
Migration Workbench for SQL Server 7.0 is going to be released,
please let me know?
And the other question is -- Is there a possiblity that only few
tables from the legacy system can be migrated into Oracle 8? and
if yes, how -- details please?
Thanks,
Neeta.
nullNeeta Singh (guest) wrote:
: Hi!
: I've an urgent task of migrating data from SQL Server 7.0 to
: Oracle 8 for Oracle Financials Application. When is the
: Migration Workbench for SQL Server 7.0 is going to be released,
: please let me know?
: And the other question is -- Is there a possiblity that only
few
: tables from the legacy system can be migrated into Oracle 8?
and
: if yes, how -- details please?
: Thanks,
: Neeta.
We plan on having a beta version of this capability in early
August. Contact [email protected] if you want to register as
a Beta tester.
Yes, you can update the Oracle model in OMW to remove those
tables you are not interested in, you can also select to just
migrate tables & data and nothing else.
Donal
null -
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 -
Conn problem SQl Server 64 Bit to Oracle 32 bit using SSIS packages
Hi,
I am facing the problem with connection SQL(64 bit) to Oracle(32 bit).
Please give me the solution/guide in right direction.
Environment is
S1-----> DBServer : 64 bit Windows Server 2003 Enterprise Edition, 64 Bit SQl Server EE, 64 Bit Oracle 10g Client
S2----->.AppServer :32 bit Windows Server 2003 Enterprise Edition, IIS, 32 Bit Oracle 10g Client & Server DB
I have doubt like....
1.Can i install 32 bit oracle also at (S1) 64 bit SQL Server(SSIS)
or only 64 bit oracle?
2.Running command line for SSIS packages at S1
i am unable to connect S1---->S2 using SSIS packages?
How can i solve this problem? pl give steps for going right direction.
Thanks
JOHN
[email protected]Fabio D'Alfonso wrote:
Hi,
I was setting up VMware vCenter 4.1 (probably the only well known and largely used product with this lethal mix) and needed to setup an ODBC access to Oracle on the 32 bit side of Windows to setup the Update Manager server component, which is still a 32 bit application)
The problem with Oracle configuration is that in no way I found a 32 bit ODBC registered driver after the setup (of the 32 bit client and the 64 database server). I tried some third party driver for oracle (e.g. easysoft).They registered in the 32 bit ODBC manager but they never got a successful connection.
Also if this vCenter requirement is questionable (more questionable considering that the setup of this 32 component is not allowed on a 32 separate OS, not because it is separate but because is a 32 bit OS) I would get it working.
Could suggest a way to get this working?
Thanks
Fabio D'AlfonsoWhen you install the Oracle client software on Windows (which is necessary to support ODBC, as the Oracle ODBC driver sits on top of the native client software) the ODBC driver is NOT installed by default. You have to go back and do a "custom" install and select the "Windows components".
Maybe you are looking for
-
Is this a bug for 10.3.9 installation
Hi everyone especially mac experts This is my first visit to this forum. I have been using my Powerbook g4 12 inch for 3 - 4 years, never had any problem til now!! My mac has problem all the sudden, got hacked or something, I dont know, I cannot even
-
I've been having a little trouble ever since I updated to iTunes 7. My nano no longer has my music on it and for some reason can only be seen from the desktop whenever I plug it in. In iTunes all it does is give me this message: "iTunes cannot read t
-
Oracle 9i and Red Hat AS 4.0
How to install Oracle 9i on Red Hat AS 4.0 ?
-
Function module for calculating sigma balance
Is there any function module available in SAP for calculating sigma balance. Thanks Gaurav
-
How to reduce storage in "other"?
So recently I've been trying to free up some space on my MacBook Pro. I have been able to reduce the size of most of the categories (music, movies, apps, etc.) But I dont know exactly how to reduce "other". As of now I have 165.36 gb in my "other" se