I tried with the spool option to get
the data from the tables in the oracle.
For this go to pl/sql editor, go to file menu, select spool, asks for a
file name give the file name you want, later type the select command from
which you want the data. and select spool of option from the file menu.
eg; select * from alarm;
After spooling i got the file alarm.LST as the attached (it will be there
in C:/orant/bin). Save that file as .txt file.
Now go to mysql prompt as a root user.
1) choose any of the default database by using the command
eg: use test
2) create the table alarm using the same columns, data types
(here data types may differ) as in oracle
eg;
mysql> CREATE TABLE ALARM (
->
ARRIVED
DATE NULL,
->
DETECTED
DATE NULL,
->
NAME
VARCHAR(20) NULL,
->
TYPE
INTEGER(1) NULL,
->
ALARMLEVEL
INTEGER(1) NULL,
->
VERIFIED
INTEGER(1) NULL,
->
DISCLOSED
INTEGER(1) NULL,
->
CATEGORY_NUM INTEGER(1)
NULL,
->
EVENTID
INTEGER(5) NOT NULL,
->
REASON
VARCHAR(60) NULL
-> );
3) Use the LOAD DAT INFILE command for data to import from .txt
file (copy the alarm.txt file into c:\mysql\data\test (if we use test
database))
eg; mysql> LOAD DATA INFILE 'alarm.txt' INTO TABLE
alarm;
Here the data is not inserting properly: Bcs
1) The data in the alarm.txt file should be like each colum data
should be seperated by \t and each row should be separated by \n . and
from spool the data is not coming in the desired format. I did not find any
suitable command/option to get the spooling file with the desired delimiters.
Colud any one suggest me here.
2) The date format is different in oracle and mysql. This also i took
care externally.
3) Even i tried by formating the data in the required (see the
attached alarm.txt for the format), getting the result as the following .
Not inserting the data properly.
mysql> LOAD DATA INFILE 'alarm.txt' INTO TABLE alarm;
Query OK, 1
row affected (0.00 sec)
Records: 1 Deleted: 0 Skipped: 0
Warnings: 1
mysql> select * from
alarm;
+------------+------------+------------+------+------------+----------+-----------+--------------+---------+-------
-+
|
ARRIVED | DETECTED |
NAME | TYPE | ALARMLEVEL | VERIFIED |
DISCLOSED | CATEGORY_NUM | EVENTID |
REASON
|
+------------+------------+------------+------+------------+----------+-----------+--------------+---------+-------
-+
|
2004-09-27 | 0000-00-00 | 2004-09-27 | 0
| 0
| 0
| 0
| 0
| 0 |
|
+------------+------------+------------+------+------------+----------+-----------+--------------+---------+-------
-+
1
row in set (0.00 sec)
mysql>
I tried with another command mysqlimport. but that command also seems to
be work with the above format only.
Please give me a solution for this. Is there any other way to do
this from oracle. My aim is dumping the data from oracle to
mysql.
Thanks,
Narasimha
-----Original Message-----
From: Praneesh
Prakashan (WT01 - TELECOM SOLUTIONS)
Sent: Tue 9/28/2004 9:48 AM
To: Lakshmi NarasimhaRao (WT01 - TELECOM SOLUTIONS); Jathish
Maruthoormana Jayanthan (WT01 - TELECOM SOLUTIONS)
Cc: Deepak
Nagarajan (WT01 - TELECOM SOLUTIONS)
Subject: RE: Using XML with
my Sql
Hi
Narasim,
In
the Pro* C files (dbids.pc, dbtutil.pc), synonyms are being
used.
regards,
-
Praneesh
Hi,
As per our
discussion, You can create an alias or
synonym for a MyISAM
table by defining a MERGE
table
that maps to that single table. Synonym is an alias for any table,
view or other object in database.
May i know where in the code they used synonyms?. Attached i sthe document
for merging tables.
Thanks,
Narasimha
-----Original Message-----
From: Jathish
Maruthoormana Jayanthan (WT01 - TELECOM SOLUTIONS)
Sent: Fri
9/24/2004 7:44 PM
To: Lakshmi NarasimhaRao (WT01 - TELECOM
SOLUTIONS)
Cc:
Subject: FW: Using XML with my
Sql
XML Support for MySQL support
-----Original Message-----
From: Bishnu
Prasad Panda (WT01 - TELECOM SOLUTIONS)
Sent:
Thursday, September 16, 2004 6:32 PM
To: Deepak
Nagarajan (WT01 - TELECOM SOLUTIONS); Jathish Maruthoormana Jayanthan
(WT01 - TELECOM SOLUTIONS); Rajarshi basu (WT01 - TELECOM SOLUTIONS);
Vanita Naidu (WT01 - TELECOM SOLUTIONS)
Subject: Using XML with my Sql
A good doc on using mysql with xml.
Regards,
Bishnu Prasad
Panda
Wipro Technologies
Mitel Porting | Telecom & Internetworking
PSTN : +91-80-25538301 | Ext: 2415
Mobile: 9845758301
This message may contain
information confidential to WIPRO Technologies