Reading SQL Server from Oracle table
Hello
Oracle 11.2.0.1
Windows XP Prof Edition
After you create the DSN name DPO when I tried to connect the database sql server 2005 Enterprise edition on the same PC, I failed to establish connectivity.
Here's what I did:
C:\Documents and Settings\Administrateur > type %oracle_home%\network\admin\listener.ora
listener.ora # Network Configuration file: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(= Extproc PROGRAM)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = opd)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = dg4odbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4) (PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\Administrator
C:\Documents and Settings\Administrateur > type %oracle_home%\network\admin\tnsnames.ora
tnsnames.ora # Network Configuration file: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
DPO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = newserver4)
(PORT = 1521)
)
)
(CONNECT_DATA = (SID = opd))
(HS = OK)
)
C:\Documents and Settings\Administrateur > type %oracle_home%\network\admin\sqlnet.ora
sqlnet.ora # Network Configuration file: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers can opt for
# install 'Software Only', this file does not exist and without the native
authentication #, they will not be able to connect to the database on NT.
SQLNET. AUTHENTICATION_SERVICES = (NTS)
NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
C:\Documents and Settings\Administrateur > lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production 31 December 2013 18:26:13
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start date December 31, 2013 18:05:31
Uptime 0 days 0 h 20 min 43 sec
Draw level off
Security ON: OS Local Authentication
SNMP OFF
Listener parameter File C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
C:\app\administrator\diag\tnslsnr\newserver4\listener\alert\log.XML log listener
Summary of endpoints listening...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=newserver4) (PORT = 1521)))
Summary of services...
Service 'CLRExtProc' has 1 instance (s).
Instance of 'CLRExtProc', status UNKNOWN, has 1 operation for this service...
"Opd" service has 1 instance (s).
Instance "opd", status UNKNOWN, has 1 operation for this service...
Service "orcl" has 1 instance (s).
Instance "orcl", State LOAN, has 1 operation for this service...
Service 'orclXDB' has 1 instance (s).
Instance "orcl", State LOAN, has 1 operation for this service...
The command completed successfully
C:\Documents and Settings\Administrateur > tnsping DPO
AMT Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production 31 December 2013 18:26:29
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Use settings files:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
TNSNAMES adapter used to resolve the alias
Try to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = newserver4) (PORT = 1521))) (CONNECT_DATA = (SID = opd)) (HS = OK))
OK (40 msec)
C:\Documents and Settings\Administrateur > type %oracle_home%\hs\admin\initopd.ora
# This is an example of initialization file of the agent that contains the HS settings
# necessary for the database to ODBC gateway
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = DPO
HS_FDS_TRACE_LEVEL = off
#
# Required for the non-Oracle system environment variables
#
#set < varenv > = < value >
C:\Documents and Settings\Administrateur > sqlplus scott/tiger
SQL * more: Production release 11.2.0.1.0 on Mar 31 18:27:18 dec 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With partitioning, OLAP, Data Mining and Real Application Testing options
SQL > drop database link DPO;
Database link dropped.
SQL > create DPO link database to connect to 'his' identified by 'girish' using 'opd ';
Database link created.
SQL > select count (*) in the ny@opd;
Select count (*) in ny@opd
*
ERROR on line 1:
ORA-28500: connection between ORACLE and a non-Oracle system has sent this message:
[Microsoft] [ODBC driver manager] Name of data source not found and no default value
specified driver {IM002}
ORA-02063: preceding 2 lines of OPD
SQL > exit
Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.1.0 - Production
With partitioning, OLAP, Data Mining and Real Application Testing options
C:\Documents and Settings\Administrateur >
PS: I do not know why I am not able to see my question above on the forum of heterogeneous connectivity , while the thread was generated:https://community.oracle.com/thread/2616787
Thanks and greetings
Girish Sharma
Something new I learned today (32-bit and 64-bit): name not found and no data source driver by default specified - Dev Articles
Tags: Database
Similar Questions
-
Query in sql server from Oracle 9.2
Hello
How can I connect and run the query to Oracle without using other products (DG4MSQL, etc)?
using 9.2.08Hello
I say it is 'free' because Dg4ODBC is included in your license of RDBMS and simply provide a third party ODBC driver.
See this note-Gateway and connectivity generic licensing considerations (Doc ID 232482.1)
You must install and configure in an ORACLE_HOME on a machine somewhere then you can use the links in the database to connect to and select databases non-Oracle.
Take a look at these notes depending on the platform that you plan to use-How DG4ODBC Setup on Linux x 86 32 bit (Doc ID 466228.1)
How to set up DG4ODBC on 64 bit OS Unix (Linux, Solaris, AIX, HP - UX Itanium) to connect to Oracle databases Post Install (Doc ID 561033.1)
How the installer DG4ODBC (gateway for ODBC Oracle database) on Windows 32 bits (Doc ID 466225.1)
How the installer DG4ODBC (gateway for ODBC Oracle database) on 64-bit Windows operating systems (Doc ID 1266572.1)As I said in my previous update if SQL * Server is your non-Oracle database then a stand-alone installation on Windows is the best option in order to use the Microsoft ODBC driver, although there is now a Linux x 86-64 bit available MS ODBC.
Please read carefully the notes that I called because they should have the information you need.
Kind regards
Mike -
SQL server from Oracle 11 g connection
Hello
I know there are a lot of threads available for this post, but please help me
* step by step in the process by linking the 2 servers.
I tried everything on internet, but received the error connection closed after DNS name tnsping. Should I run any sort of thing instance in SQL server?
I don't have any access on SQL server. All what I have to do this must be only to the Oracle server. I obtained all this information and created ODBC (using the SQL server driver) and successfully tested the connection to the Oracle server. Altered INIT *. ORA, TNSNAMES. ORA and LISTENER. ORA but when ping TNS terribly getting the afore said error.
My environment: Server Oracle 11 g - SQL server 2008 (both in the windows platform).
My
TNS names entry
GSIS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.1.1.1)(PORT = 63455))
(CONNECT_DATA = (SID = GSIS)
(SERVER = DEDICATED)
(HS = OK)
)
)
Entrance to the listener
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP) (HOST = COB417147.cob.apac.bosch.com)(PORT = 1522))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1)
(= Extproc PROGRAM)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = GSIS)
(ORACLE_HOME = C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1)
(PROGRAM = hsodbc)
)
)
and
initGSIS
entry
# This is an example of initialization file of the agent that contains the HS settings
# necessary for the database to ODBC gateway
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = GSIS
HS_FDS_TRACE_LEVEL = OFF
#
# Required for the non-Oracle system environment variables
#
#set
**************************************************
When I get tnsping
AMT closed connection.
I'm stuck here terribly.
Please guide...Sam,
The link between DG4ODBC and SQL * Server is managed by the information and the driver specified in the system DSN defined as parameter HS_FDS_CONNECT_INFO.
When you create the database link, you should double quotes around the user and the password under SQL * Server is case-sensitive. If quotes are not used, they are translated to uppercase, so try-create database GSIS_PQSR link
connect to 'User_name' identified by 'PASSWORD' using 'GSIS ';in the correct case as defined on SQL * Server.
For the ora-2019 check that-
-initGSIS.ora is located in the C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\hs\admin directory
-that the tnsnames.ora entry is located in the directory $ORACLE_HOME\network\admin for the RDBMS not the C:\Oracle\app\amk1cob\product\11.2.0\dbhome_1\network\admin of the entry door.Kind regards
Mike -
Migration from SQL Server to Oracle during 11.1.2.4 upgrade
Hi all
To further expand on the title, wanted to check if it is possible to migrate from SQL Server to Oracle, while improving 11.1.2.1 to 11.1.2.4 on brand-new material. There is a change in all the components (s/w, h/w, RDBMS) so I wanted to run this generic statement by the forum to see what the experts think.
Where in the equation can count us on LCM?
I know that John Goodwin had already answered a few questions on the same subject for previous versions, but as 11.1.2.4 is a different game... I would be grateful if someone could share their thoughts.
Thank you!
If you are installed on hardware costs and migration then it should be independent of the RDBMS. Not to say there is no problems with passing of 11.1.2.1 to 11.1.2.4 (if you use planning, for example, business rules-> Calc Manager) but they certainly should not be linked to the fact you've changed the underlying database.
-
Migration from SQL Server to Oracle database
I have 2 questions:
1. we intend to convert our sql server databases oracle OLTP databases. I tried to use SQL Developer to migrate a database of small sql server to oracle (size 5 GB) database. It was fine. When I tried to migrate to a different database (size 90G), it takes too much time. The problem with sql developer is I can not pick and choose tables. 250 paintings, I need to migrate tables abt 80 (the size will be abt 50 G). What is everyone can share their experiences, as appropriate, converting databases of size average sql server for oracle databases? other options?
2. I intend to convert the sql server ddl to oracle ddl. I have tested bcp out and use sql loader to import the data. Right now I am manually creating the oracle tables sql server tables. I use http://download.oracle.com/docs/cd/E11882_01/gateways.112/e12069/apa.htm#BABCIIDI to convert the code. Are there other ways better to convert sql DDL DDL Oracle Server?
Thanks in advanceDDLS must be converted manually. Oracle is not SQL-Server.
If for example, you have the option of partitioning, you should consider using the partitioning index and when it is possible. Not all tables must be hash tables. Do postpone you creation of segment or not? What type of tablespace? Set yourself free percentages and allows you to manage when the data block is on the free list and how much is reserved in the block of data to update rows in this block?
There are many considerations to be taken with regard to the physical database design.
Using BCP and SQL * Loader sound good. SQL * Loader is fast and scalable - use it to load up to 3.6 million lines every 60 seconds. Direct and parallel charges will give the best performance in this regard (assuming that the underlying table structure and use supports this approach).
-
Problem with the migration of key primary and foreign from SQL Server to Oracle
Hi people, I use SQL Developer to migrate Oracle to a SQL database, and I'm stuck with a few questions:
So far, the worst of them is the fact that I can not migrate the PKs and FKs. After having successfully captured the model DB in SQL Server and Oracle conversion, when the tool generates scripts, all ALTER TABLE queries that add pharmacokinetics and the FKs have their columns duplicate targets.
for example: when I'm trying to migrate a simple table that contains an Id (PK) and the columns name, the tool generates the following scripts:
PROMPT create Table TestTable...
CREATE TABLE TestTable)
ID NUMBER (10,0) NOT NULL,
Name VARCHAR2 NOT NULL
);
The PROMPT create constraint primary key on the table TestTable PK_TestTable...
ALTER TABLE TestTable
ADD CONSTRAINT PK_TestTable PRIMARY KEY
(
ID,
ID
)
ENABLE
Regarding the FKs, the tool duplicates the columns thus:
ALTER TABLE SomeTable
ADD CONSTRAINT FK_SomeTable_SomeTable2 FOREIGN KEY
(
SomeTable2Id,
SomeTable2Id
)
REFERENCES SomeTable2
(
ID,
ID
)
ENABLE
;
Does anyone have an idea on how to solve these problems? I would be very grateful for answers!Hi Fernando,
I was unable to reproduce this problem. My primary / foreign keys when defined using unique columns.
The PROMPT create constraint primary key on the suppliers table PK_Suppliers...
ALTER TABLE suppliers
ADD CONSTRAINT PK_Suppliers PRIMARY KEY
(
Vendor No.
)
ENABLE
;I tried a few things like
capturing twice and rename the two models of the same
Rename the converted templates
but without success.
I think that this problem occurs is in the capture phase or convert.(1) you perform the capture online or offline?
(2) can provide you a DDL together for one of these tables and the indexes to see if I can reproduce?
(3) made of capture or convert fail or be again at any stage?I all else fails I would attempt a capture and convert again using a new repository (create a new schema in Oracle and associate him the migration repository).
Kind regards
Dermot
SQL development teamPublished by: Dermot ONeill on October 22, 2009 12:18
-
Replication sql server to oracle
Hi all
Anyone here good at replication?
Can you help me what freeware, or the poor woman script or cheaper tool (compared to GG) to replicate the table from sql server to oracle?
I tried Googling it, but it is simply too complex to understand :(
Help, please...
Thank you
zxyyxes2013 wrote:
Well he has trigger that records the primary key and the action made next to sqlserver.example of
'100', 'I '.
'200', 'U '.
' 300', 'd'Therefore the corresponding action will be also in oracle.
But I want a good solution of script, that's why I just give you the trick :(
Thank you...
You should be this announcement on the forum SQL Server, because the script will need to be written in T - SQL to execute against this DB.
-
Error of date when migrating to SQL Server to Oracle
Hi all
I'm the database migration SQL Server to Oracle.
But the tool I use is not secret the date type GBA, so I'm stuck with tables that have particular date types.
For example: the 'DATECAPTURED' column in the 'SIGNATURE' table in the SQL Server database has values:
15-02-2013 10:03:48.387
15-02-2013 10:01:05.930
15-02-2013 09:59:07.197
15-02-2013 09:50:15.797
15-02-2013 09:39:15.557
15-02-2013 09:37:12.643
Why oracle can be able to accept this type of date format? :( I thought he is more intelligent than SQLserver :)
My solution is to change any date to varchar2 (30).
More bright ideas? while I cannot change data types?
Thank you
zxyyxes2013 wrote:
Thank you Justin :)It's just that I have a lot to learn in a fastrack way, I am a very busy person :(
Well, just a piece of advice. If you read the watch (and wait) documentation for the responses on the web and on various forums and try to do all the work, you are probably going to stay busy!
in any case, I'll try another tool like sqldeveloper migration. For now, I have many things to research so I'd settle for the same time, workaround. New test is required for the tool.
Good luck!
I was taking just opportunities here if someone met the same problem as mine ;)
It was not a problem of IMO, but was ignorance. People here know any Timestamp data type for SOME time I think and how, because they read the docs!
Aman...
-
data replication with ODI between SQL SERVER and ORACLE
Hello world
First of all, I want to migrate database SQL SERVER and ORACLE DB tables.
And then make online (synchronous) replication from SQL SERVER to ORACLE using ODI.
I have not used before ODI.
How to use the ODI for this?1. create a master repository and connect to the "topology Manager.
2. in the topology Manager, you must configure the following
2.1 create a data server for the Oracle under Oracle database in the physical connection
2.2. create a database for the SQL Server database server in SQL Server in the physical connection. To do this, the jdbc for sql server driver.
2.3 implement the logical connection and frame
2.4 create a workrepository in the topology manager repositories tab
3. connect to the designer and follow these steps
3.1 create a template for the SQL Server source and reverse (import) the datastores (tables) to the model.
3.2 the value of the model for the target of the Oracle
3.3 create a (mapping) interface, under the table in schema define the source and then add it to the target and bind
3.3 on the flow tab, you must set the Modules (KMs) of knowledge to perform the load. You must have imported the KMs before creating the interface.
3.4 in IKM put 'create table traget' to 'yes '.
4 run the interface to load data from SQL to Oracle ServerThank you
Fati -
Different output for the same query in SQL Server and Oracle
I have two tables table1 and table2
-table1 has two columns c1 int and varchar c2. There are no constraints added in it. It contains data as shown below
C1 c2
-------------------
d 6
5 d
102 g
6%
f 103
5.
501 j
1 g
601 n
2 m
-table2 has only a single column c1 int. There is no added in constraints. It contains data as shown below
C1
----
6
1
4
3
2
now when I run below, given the query in sql server and oracle it gives me different results
Select *.
FROM table1
table2 on table2.c1 = table1.c1 inner join (SELECT ROW_NUMBER() (any ORDER by ASC c1) AS c1 from table2)
output of SQL server
------------------------
C1 c2 c1
--------------------------------
1 g 1
2 m 2
3 h 3
4 g 4
5 d 5
release of Oracle
----------------------
C1 C2 C1
---------------------------------
5 d 5
4 g 4
3 h 3
1 g 1
2 m 2
If you notice the first column in the two outputs. It is sorted in sql server and no oracle.
Why he behaves differently in oracle? Is there a way I can fix this problem in oracle?
Thank you
JigsIt is NOT a behavior "differently" in Oracle; you did not specify just an order that you expect of your results, so you'll get output in what order the fantasies of the database showing (ie. no guaranteed order). It is an artifact of the way the database chooses to collect the data and databases (or same sets of data within the same database) can and will most likely behave differently.
Same SQL Server will not be guaranteed to always get your data in an orderly manner if you exclude the order by clause, even if you think that there always display the data in an orderly manner.
Your solution is to add an order by clause, in the TWO databases, to force the order of the data output.
-
Planning for SQL server and Oracle db
Hi friends
We intend to improve our environment Hyperion of 9.3.3 to 11.1.2.2. and we will go from SQL server as our RDBMS Oracle.
If we change DBMS, do we have to rebuild the total application or is there an easy way to migrate from sql server to Oracle
Please suggest
Thank you
Upgrade the application to 11.1.2.2 while remaining on the SQL Server, then use LCM to export the application, remove the application, update the data source to point to Oracle, use LCM to import.
See you soon
John
-
SQL Server->; conversion Oracle database FDM
Anyone has any experience in the conversion from SQL Server to Oracle for FDM? (11.1 oracle now supports).
My thought would be to re - treat all files of importation rather than try a conversion of database type.
Thoughts?
Thank you
-JohnJohn,
FDM has always support Oracle DB as a repository.
To convert the SQL Server DB to an Oracle DB server, you have to re-create the metadata for the application at hand. Currently, the feature export to XML of FDM does not take into account differences in filing structures and cannot be used.
You must then re-import all files or continue on creating this day with impatience.
Thank you.
-
Interlink with Sql server and Oracle
Hello
We have some data in SQL Server.
We need to link SQL Server and Oracle Database. To make reports in Oracle Apex.
Please someone guide me to interconnect with Oracle database
Kind regards
ThérèseTherese,
You can find more information on gateways in this available in My Oracle Support note-Note to master for the Oracle Gateway (Doc ID 1083703.1) products
Kind regards
Mike -
conversion of code from sql server to oracle
Hi all, need help... I have the following sql server code and I need to convert this code in oracle... Please help me with this...
See you soon...
USE [HPSEB]
GO
/ * Object: UserDefinedFunction [dbo]. [ALG_GetData] Script Date: 2011-10-31 18:32:41 * /.
SET ANSI_NULLS
GO
SET QUOTED_IDENTIFIER ON
GO
-Select * from ALG_GetData (31)
ALTER FUNCTION [dbo]. [ALG_GetData] (int @code)
-RETURNS @Results TABLE (value nvarchar (4000))
RETURNS the array @temptb (sno int identity (1,1), meterno varchar (12), METERDATETIME varchar (35),)
eventoccuretime varchar (35), code int, int event_id, duration type varchar (35), int flag)
AS
-This function takes a parameter; It's code int
BEGIN
declare @tempdate datetime
declare @TIME varchar (35)
declare @STATUS int
declare @Duration varchar (20)
declare @METERNUMBER varchar (12)
declare @METERDATE varchar (35)
declare @event_id varchar (35)
declare @sno int
declare @tempmetno varchar (12)
declare @flag int
DECLARE MyCursor cursor static for
Select event_id, TIME, STATUS, duration, METERNUMBER, METERDATE, flag
of Xml_EVENT where CODE = @code and EVENT_Id < =.
(select MAX (EVENT_Id) of xml_event where code = @code and STATUS = 0)
order by METERNUMBER, CONVERT (date, METERDATE, 103), EVENT_Id desc
OPEN mycursor
EXTRACT NEXT FROM mycursor INTO @event_id, @Duration, @TIME, @STATUS
@METERNUMBER, @METERDATE, @flag
While (@FETCH_STATUS = 0)
BEGIN
If (@STATUS = '0')
Start
insert into @temptb (event_id, meterno, METERDATETIME, eventoccuretime, code, flag)
values (@event_id, @METERNUMBER, @METERDATE, @TIME, @code, @flag)
Set @tempdate = convert (datetime,@TIME, 103)
Set @tempmetno = @METERNUMBER
end
on the other
Start
If (@TIME <>")
Start
set @Duration = DATEDIFF (MI, convert (datetime,@tempdate, 103), convert (datetime,@TIME,103))
end
on the other
Start
set @Duration = convert (varchar, (convert (int, substring (@Duration, 5.2)) * 60) +)
(convert (int, substring (@Duration, 8, 2)))
end
Select @sno = max (sno) of @temptb
Update @temptb set Duration = @Duration where sno = @sno and meterno = @tempmetno
end
SET @event_id = "
SET @TIME = "
SET @STATUS = "
SET @Duration = "
SET @METERNUMBER = "
SET @METERDATE = "
FETCH NEXT FROM mycursor INTO @event_id, @TIME, @STATUS, @Duration, @METERNUMBER, @METERDATE, @flag
END
CLOSE MyCursor
DEALLOCATE MyCursor
-update @temptb set eventrestoretime = DATEADD (MINUTE, convert (int, time), CONVERT (datetime, eventoccuretime, 105))
RETURN
ENDtry these below
but you must make a few changes like sno you can use a sequence and each time 'select your_seq.nextval in double sno.
create or replace package pkg_ALG_GetData as
type rw is record
(number (1) number of sno, meterno varchar2 (12), METERDATEv_TIME varchar2 (35),)
eventoccureTIME varchar2 (35), code event_id number, number, duration varchar2 (35), flag of number);type rec_set is ref cursor return rw;
end;
/Create procedure ALG_GetData (code number)
-Results of PERFORMANCE TABLE (value nvarchar2 (4000))
p_ret in the pkg_ALG_GetData.rec_set) as-This function takes a parameter; This is the code number
cursor c_MyCursor is select event_id, v_TIME, STATUS, duration, METERNUMBER, METERDATE, flag
Xml_EVENT where CODE = code and EVENT_Id<>
(select MAX (EVENT_Id) of xml_event where code = code and STATUS = 0)
order of METERNUMBER, to_date (METERDATE, ' dd/mm/yyyy'), EVENT_Id desc;r_MyCursor c_MyCursor % rowtype;
tempdate date;
v_TIME varchar2 (35)
STATE number
Duration varchar2 (20)
METERNUMBER varchar2 (12)
METERDATE varchar2 (35)
event_id varchar2 (35)
number of Sno
tempmetno varchar2 (12)
Indicator number
BEGINOpen c_MyCursor;
loop
Search in r_MyCursor;
When the output c_MyCursor % notfound;
If (STATUS = '0') thenStart
Insert the number of temptb (event_id, meterno, METERDATEv_TIME, eventoccureTIME, code, flag)
values (r_MyCursor.event_id, r_MyCursor.METERNUMBER, r_MyCursor.METERDATE, r_MyCursor.code, r_MyCursor.flag)
tempDate = to_date (v_TIME, ' dd/mm/yyyy');
tempmetno = METERNUMBER;
end;on the other
Start
If (v_TIME <> ")Duration = to_date(tempdate,'dd/mm/yyyy')-to_date(v_TIME,'dd/mm/yyyy');
end;on the other
Duration = to_char (to_number (substr (duration, 5.2)) * 60 +)
TO_NUMBER (substr (duration, 8, 2)))Select max (sno)
in sno temptb;Update temptb set duration = duration where sno = sno and meterno = tempmetno;
end
event_id = ";
v_TIME = ";
STATUS = ";
Duration = ";
METERNUMBER = ";
METERDATE = ";
END
CLOSE C_MyCursor;-update temptb set eventrestorev_TIME = DATEADD (MINUTE, convert (number, duration), CONVERT (datev_TIME, eventoccureTIME, 105))
Open the p_ret for
Select event_id, meterno, METERDATEv_TIME, eventoccureTIME, code, flag
of temptb
where...;
END;
/ -
How to migrate from SQL server to oracle 11g
Hello
I have a lot of tables in sql server, and I want to connect them in oracleWelcome to the forum,
Hello
To create a link Oracle with SQL Server follow these steps:
1. install Oracle ODBC drivers on the server (your Oracle database local) who will have access to the remote SQL Server database by using the database link.2. configuration of the ODBC connection on the local Oracle using the Windows ODBC Data Source Administrator database
3 test pilots to verify ODBC connectivity is made to the SQL Server database.
4. make sure that your global_names parameter is set to False.
5. configure Oracle heterogeneous services by creating an initodbc.ora file in the Oracle database.
7 change the Listener.ora file.
SID_NAME is the DSN for the remote database.
ORACLE_HOME is the real path to the file at Oracle.
PROGRAM says Oracle heterogeneous services.SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = Cas30C) - enter the DSN on this line
(ORACLE_HOME = c:\oracle10gdb)--Inscrivez your Oracle home
(Program = hsodbc)) )8. change the Tnsnames.ora file. It's accessed by users Oracle database installation connect for ODBC drivers
(DESCRIPTION =
(ADDRESS_LIST =
(Address = (PROTOCOL = TCP)
(HOST =
-(X server)
(PORT = 1521))) -Enter the port on which the server x installing Oracle
-is listening
(CONNECT_DATA = (SID = Cas30c)) - enter the name of the DSN
(HS = OK)-enter this value. He indicates to Oracle to use transfer services
)9 recharge the listener on a local Oracle database
10. create a link of database on the local Oracle installation that accesses the heterogeneous connection, which, in turn, connect to SQL Server.
11 execute SQL Select Server from the Oracle installation using the database link
Thank you
BelMan :)
Maybe you are looking for
-
I bought a terabyte of storage a month and now I have only 5 GB, because I did not renew the terabyte of storage. Is the amount of staorage I haven't used postponed to the next month?
-
I am a lover of big train and waited for a game like this since the first microsoft train sim please help
-
What information do I need to access windows exlorer ntlworld email on my i pod touch 4
What information do I need to access windows exlorer ntlworld email on my i pod touch 4
-
C309n wifi connects to the computer
My C309n does not appear on my iMac printer/Scanner preferences window. I have my Airport next to my computer and in the whole of the House of my all-in-one. Any suggestions?
-
It must be something incredibly simple, but I'm having a difficult time finding an answer! I can't find my taskbar at the bottom of my screen. I tried all the suggestions and it's just not there. How can I get it back?