Re: importing data into mysql from oracle using a text file

2004-09-30 Thread Harald Fuchs
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:

 Thanks, it is working for the mentioned format.
 
 Is there any method for importing directly the spooled file from oracle without 
 changing the file format into the required format like using tab and newline. 

I don't know Oracle, but maybe two named pipes might work:

mkfifo pipe1
mkfifo pipe2
oracleexport pipe1 
mysql db -e load data infile 'pipe2' 
sed -e whatever pipe1 pipe2


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



importing data into mysql from oracle using a text file

2004-09-29 Thread lakshmi.narasimharao
Title: Message





 Hi,

   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 samecolumns,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 | -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


  
  -Original Message-From: Lakshmi 
  NarasimhaRao (WT01 - TELECOM SOLUTIONS) Sent: Monday, September 
  27, 2004 10:07 PMTo: Jathish Maruthoormana Jayanthan (WT01 - 
  TELECOM SOLUTIONS)Cc: Praneesh Prakashan (WT01 - TELECOM 
  SOLUTIONS); Deepak Nagarajan (WT01 - TELECOM SOLUTIONS)Subject: 
  RE: Using XML with my Sql
  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 

Re: importing data into mysql from oracle using a text file

2004-09-29 Thread Andrey Hristov
Can you post one or 2 sample lines from alarm.txt ?
Regards,
Andrey
P.S.
(i am not on [EMAIL PROTECTED] so add me to the CC:)
[EMAIL PROTECTED] wrote:
Hi,
	   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,
	-DISCLOSEDINTEGER(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 | -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
		 

			-Original Message-
			From: Lakshmi NarasimhaRao (WT01 - TELECOM SOLUTIONS) 
			Sent: Monday, September 27, 2004 10:07 PM
			To: Jathish Maruthoormana Jayanthan (WT01 - TELECOM SOLUTIONS)
			Cc: Praneesh Prakashan (WT01 - TELECOM SOLUTIONS); Deepak Nagarajan (WT01 - TELECOM SOLUTIONS)
			Subject: RE: Using XML with my Sql
			
			
			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 

RE: importing data into mysql from oracle using a text file

2004-09-29 Thread lakshmi.narasimharao
Title: Re: importing data into mysql from oracle using a text file






The sample lines are like this in 
alarm.txt

  
  ARRIVED DETECTED 
  NAME 
  TYPE ALARMLEVEL V DISCLOSED CATEGORY_NUM 
  EVENTID - 
  -  - -- - -  
  
  - 
  REASON 
  
   
   
  
   
  27-SEP-04 27-SEP-04 
  alaram 
  0 0 
  N 
  0 
  2 
   
  1 
  
   
  
   
  27-SEP-04 27-SEP-04 
  MiTel 
  0 0 
  N 
  0 
  2 
   2 
  
  
  The above lines i am not able to insert into mysql. 
  
  
  After changing the format as below(as in the 
  sample.txt)i am able to insert into mysql but not correclty. Couls you 
  please help me in this.
  
  
  2004-09-27\t2004-09-27\talaram\t0\t0\tN\t0\t2\t1\n
  
  thanks,
  narasimha
  
  
  
  


Confidentiality Notice The information contained in this electronic message and any attachments to this message are intendedfor the exclusive use of the addressee(s) and may contain confidential or privileged information. Ifyou are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediatelyand destroy all copies of this message and any attachments.

ARRIVED   DETECTED  NAME  TYPE ALARMLEVEL V DISCLOSED CATEGORY_NUM 
  EVENTID
- -  - -- - -  
-
REASON 
 
   
 
27-SEP-04 27-SEP-04 alaram   0  0 N 02 
1
   
 
   
 
27-SEP-04 27-SEP-04 MiTel0  0 N 02 
2
   
 
   
 
 2004-09-27  \t  2004-09-27  \t  alaram  \t  0   \t  0  
 \t  N   \t  0   \t  2   \t  1   \n-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: importing data into mysql from oracle using a text file

2004-09-29 Thread Andrey Hristov
 Hi,
I did imported your data im my server but I had to do some changes to sample.txt.
I have replaced in a text editor tab\t with empty string. tab is a real tab
while \t is just a text. Additional change was to replace \n (which is text but not
newline with empty string). The I did the following (before that I have created the
table) :
mysql load data local infile /home/andrey/Desktop/sample2.txt into table ALARM FIELDS 
ESCAPED BY '\\';
Query OK, 1 row affected, 1 warning (0.03 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 1

mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1261 | Row 1 doesn't contain data for all columns |
+-+--++
1 row in set (0.00 sec)
mysql select * FROM ALARM;
++++--++--+---+--+-++
| ARRIVED| DETECTED   | NAME   | TYPE | ALARMLEVEL | VERIFIED | DISCLOSED | 
CATEGORY_NUM | EVENTID | REASON |
++++--++--+---+--+-++
| 2004-09-27 | 2004-09-27 | alaram |0 |  0 | NULL | 0 | 
 2 |   1 | NULL   |
++++--++--+---+--+-++
1 row in set (0.02 sec)

You can see the warning since the number of fields was less the needed. Or maybe you 
wanted by having \n to express NULL? Last thing to do over sample.text is to mark all
places where NULL should appear with \N .

Hope this helps,
Andrey
[EMAIL PROTECTED] wrote:
Tha sample lines are like this in alarm.txt
 
ARRIVED   DETECTED  NAME  TYPE ALARMLEVEL V DISCLOSED CATEGORY_NUM   
EVENTID
- -  - -- - -  
-
REASON   
   
 
   
27-SEP-04 27-SEP-04 alaram   0  0 N 02   
  1
 
   
 
   
27-SEP-04 27-SEP-04 MiTel0  0 N 02   
  2
 
 
The above lines i am not able to insert into mysql. 
 
After changing the format as below(as in the sample.txt) i am able to insert into mysql but not correclty. Couls you please help me in  this.
 
 
2004-09-27 \t 2004-09-27 \t alaram \t 0 \t 0 \t N \t 0 \t 2 \t 1 \n
 
thanks,
narasimha
 
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: importing data into mysql from oracle using a text file

2004-09-29 Thread lakshmi.narasimharao

Thanks, it is working for the mentioned format.
 
Is there any method for importing directly the spooled file from oracle without 
changing the file format into the required format like using tab and newline. 
 
thanks,
narasimha

-Original Message- 
From: Andrey Hristov [mailto:[EMAIL PROTECTED] 
Sent: Thu 9/30/2004 2:01 AM 
To: Lakshmi NarasimhaRao (WT01 - TELECOM SOLUTIONS) 
Cc: [EMAIL PROTECTED] 
Subject: Re: importing data into mysql from oracle using a text file



  Hi,
I did imported your data im my server but I had to do some changes to 
sample.txt.
I have replaced in a text editor tab\t with empty string. tab is a real 
tab
while \t is just a text. Additional change was to replace \n (which is text 
but not
newline with empty string). The I did the following (before that I have 
created the
table) :

mysql load data local infile /home/andrey/Desktop/sample2.txt into table 
ALARM FIELDS
ESCAPED BY '\\';
Query OK, 1 row affected, 1 warning (0.03 sec)
Records: 1  Deleted: 0  Skipped: 0  Warnings: 1

mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1261 | Row 1 doesn't contain data for all columns |
+-+--++
1 row in set (0.00 sec)

mysql select * FROM ALARM;

++++--++--+---+--+-++
| ARRIVED| DETECTED   | NAME   | TYPE | ALARMLEVEL | VERIFIED | DISCLOSED |
CATEGORY_NUM | EVENTID | REASON |

++++--++--+---+--+-++
| 2004-09-27 | 2004-09-27 | alaram |0 |  0 | NULL | 0 |
  2 |   1 | NULL   |

++++--++--+---+--+-++
1 row in set (0.02 sec)


You can see the warning since the number of fields was less the needed. Or 
maybe you
wanted by having \n to express NULL? Last thing to do over sample.text is to 
mark all
places where NULL should appear with \N .

Hope this helps,
Andrey


[EMAIL PROTECTED] wrote:
 Tha sample lines are like this in alarm.txt
 
 ARRIVED   DETECTED  NAME  TYPE ALARMLEVEL V DISCLOSED 
CATEGORY_NUM  
 EVENTID   
 - -  - -- - - 

 -   
 REASON   
   
   
  
   
   
 27-SEP-04 27-SEP-04 alaram   0  0 N 0
2  
   1   
  
   
   
  
   
   
 27-SEP-04 27-SEP-04 MiTel0  0 N 0
2  
   2   
 
 
 The above lines i am not able to insert into mysql.
 
 After changing the format as below(as in the sample.txt) i am able to insert 
into mysql but not correclty. Couls you please help me in  this.
 
 
 2004-09-27 \t 2004-09-27 \t alaram \t 0 \t 0 \t N \t 0 \t 2 \t 1 \n
 
 thanks,
 narasimha
 




Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.


importing data into mysql from oracle

2004-09-28 Thread lakshmi.narasimharao

Hi,
Could any one of you suggest me a better way to bump the data in oracle 7.3 to 
mysql 4.0 classic.
Thanks,
Narasimha

-Original Message- 
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tue 9/28/2004 8:58 PM 
To: martin fasani 
Cc: [EMAIL PROTECTED] 
Subject: Re: Oracle query to mysql



Your original Oracle(R) query (slightly reformatted):

SELECT IMRTAB.IMR906 AS NUM906
, IMRTAB.IMRFLL AS FLL
, SUM(IMRTAB.IMRCLL) AS CLL
, ROUND(SUM(IMRTAB.IMRDSC),2) AS DUR
, ROUND(SUM(IMRTAB.IMRDSC)/SUM(IMRTAB.IMRCLL),2) AS PRO
, SUM(IMRTAB1.IMRCLL) AS CLL_N
, ROUND(SUM(IMRTAB1.IMRDSC),2) AS DUR_N
, ROUND(SUM(IMRTAB1.IMRDSC)/SUM(IMRTAB1.IMRCLL),2) AS PRO_N
, SUM(IMRTAB2.IMRCLL) AS CLL_R
, ROUND(SUM(IMRTAB2.IMRDSC),2) AS DUR_R
, ROUND(SUM(IMRTAB2.IMRDSC)/SUM(IMRTAB2.IMRCLL),2) AS PRO_R
FROM IMRTAB
, IMRTAB IMRTAB1
, IMRTAB IMRTAB2  /* here does the tables alias*/
WHERE IMRTAB.IMRIDE = IMRTAB1.IMRIDE (+)
AND IMRTAB.IMRIDE = IMRTAB2.IMRIDE (+) /* links by the uniqID both
alias */
AND (IMRTAB1.IMRTAR (+) = 'N') /* takes N calls and discard the
rest for IMRTAB1 */
AND (IMRTAB2.IMRTAR (+) = 'R') /* takes R calls and discard the
rest for IMRTAB2 */
AND (IMRTAB.IMRFLL BETWEEN '01/09/2004' and '10/09/2004')
AND (IMRTAB.IMRCLI=2584 AND (IMRTAB.IMR906=803xx ))
GROUP BY IMRTAB.IMR906,IMRTAB.IMRFLL
ORDER BY IMRTAB.IMR906,IMRTAB.IMRFLL


My MySQL translation:

SELECT IMRTAB.IMR906 AS NUM906
, IMRTAB.IMRFLL AS FLL
, SUM(IMRTAB.IMRCLL) AS CLL
, ROUND(SUM(IMRTAB.IMRDSC),2) AS DUR
, ROUND(SUM(IMRTAB.IMRDSC)/SUM(IMRTAB.IMRCLL),2) AS PRO
, SUM(IMRTAB1.IMRCLL) AS CLL_N
, ROUND(SUM(IMRTAB1.IMRDSC),2) AS DUR_N
, ROUND(SUM(IMRTAB1.IMRDSC)/SUM(IMRTAB1.IMRCLL),2) AS PRO_N
, SUM(IMRTAB2.IMRCLL) AS CLL_R
, ROUND(SUM(IMRTAB2.IMRDSC),2) AS DUR_R
, ROUND(SUM(IMRTAB2.IMRDSC)/SUM(IMRTAB2.IMRCLL),2) AS PRO_R
FROM IMRTAB
LEFT JOIN IMRTAB IMRTAB1
ON IMRTAB.IMRIDE = IMRTAB1.IMRIDE
AND IMRTAB1.IMRTAR = 'N' /* N calls only for IMRTAB1 */
LEFT JOIN IMRTAB IMRTAB2
ON IMRTAB.IMRIDE = IMRTAB2.IMRIDE
AND IMRTAB2.IMRTAR = 'R' /* R calls only for IMRTAB2 */
WHERE IMRTAB.IMRFLL BETWEEN '2004-09-01' and '2004-09-10'
AND IMRTAB.IMRCLI=2584
AND IMRTAB.IMR906=803xx
GROUP BY IMRTAB.IMR906,IMRTAB.IMRFLL
ORDER BY IMRTAB.IMR906,IMRTAB.IMRFLL


You were using the Oracle syntax , ...(+) to declare your outer joins.
The equivalent MySQL form is LEFT JOIN... ON 

http://dev.mysql.com/doc/mysql/en/JOIN.html


I also had to reformat the dates in your WHERE clause to be MySQL
formatted:
'01/09/2004' (dd/mm/) = '2004-09-01' (-mm-dd)

http://dev.mysql.com/doc/mysql/en/Date_and_time_types.html
http://dev.mysql.com/doc/mysql/en/DATETIME.html


Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
martin fasani [EMAIL PROTECTED] wrote on 09/28/2004 07:23:38 AM:


 Hi guys,

 I'm working in a telecom company that has Oracle for the call
statistics.
 Now we export the daily stats to a remote mySql.

 The daily resume table looks like this:

++---+-++--+
 --+++
 | IMRFLL | IMR906| IMRTER  | IMRTAR | IMRDUR   |
 IMRFAC   | IMRCLI | IMRCLL |

++---+-++--+
 --+++
 | 2004-06-01 | 803xx |   x | N  |
446.9166572 |
 40355904 | 21 | 26 |
 | 2004-06-01 | 803xx |   0 | R  | 9.414
|
 40355904 | 21 | 10 |

++---+-++--+
 --+++

 What I need it's to get a report that joins the table to itself two
times to
 get the Normal tarif ( IMRTAR=N) and the Reduced tarif (IMRTAR=R).

 In Oracle is done using Outer joins like this:
 SELECT 

Importing Data into MySQL

2003-12-19 Thread Bob Cohen
Sorry in advance for the dumb newbie question but . . . I'm using a
content management system and want to avoid the hassle of entering data
by hand when I've already got it in a delimited text file.  I get the
basic concept of using mysqlimport.  However, the source file's data
doesn't match the target file's structure.  Of particular concern for me
is that the target table has record id files the would need to be
incremented.

I get the task on the conceptual level.  E.g., map the incoming columns
with the appropriate fields in the target table and increment the record
id number.  I'm a web designer not a programmer. I'm not at all sure how
to accomplish this task. Though I would like to learn.

Any help would be appreciated.  Thanks.

Bob Cohen
b.p.e.Creative
http://www.bpecreative.com
Design and production services for the web
Put creative minds to work for you


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Importing Data into MySQL

2003-12-19 Thread Michael Stassen
If I understand correctly, your text file does not have an ID for each 
row, but the table does have an ID column.  Good.   Your table should 
have the record ID column defined as AUTO_INCREMENT.  Something like

CREATE TABLE table_name (
  ID int NOT NULL PRIMARY KEY AUTO_INCREMENT,
  other column definitions...
In that case, simply leave ID out of the columns you are importing to 
have mysql automatically fill in the ID with unique values.  That's the 
point of AUTO_INCREMENT.  The AUTO_INCREMENT column gets a unique number 
assigned by mysql if you leave it out or if you assign it the (non) 
value NULL.

See

Using AUTO_INCREMENT
  http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html and
CREATE TABLE Syntax,
  http://www.mysql.com/doc/en/CREATE_TABLE.html
and mysqlimport, Importing Data from Text Files
  http://www.mysql.com/doc/en/mysqlimport.html
in the manual for more.

Michael

Bob Cohen wrote:

Sorry in advance for the dumb newbie question but . . . I'm using a
content management system and want to avoid the hassle of entering data
by hand when I've already got it in a delimited text file.  I get the
basic concept of using mysqlimport.  However, the source file's data
doesn't match the target file's structure.  Of particular concern for me
is that the target table has record id files the would need to be
incremented.
I get the task on the conceptual level.  E.g., map the incoming columns
with the appropriate fields in the target table and increment the record
id number.  I'm a web designer not a programmer. I'm not at all sure how
to accomplish this task. Though I would like to learn.
Any help would be appreciated.  Thanks.

Bob Cohen
b.p.e.Creative
http://www.bpecreative.com
Design and production services for the web
Put creative minds to work for you



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Importing data into MySQL

2003-09-02 Thread Darryl Hoar
I have data that is in a progress database.  I need to get
a copy of the data into my mysql database.  What would
be the best approach ?  I can dump the data in any specific
format, so.


Never tried ODBC with Progress (8.2C12), so don't know if
that can/will work.

thanks,
Darryl

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: what is the best data format to start with when importing data into mysql?

2003-05-27 Thread James Moe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 27 May 2003 11:17:34 +0200, Emiliano Rustighini wrote:

I can ask for the data in any data format, but I would like to get some
advice on what is best to ask for.

  I have found text format to be the most flexible method for transferring between 
systems. It bypasses big-/little-endian problems, you can floating point as accurate 
as 
you want, etc.
  Its only downside is the increase in size, approximately 1.5x, over using binary 
formats. 

If you have some suggestions about the connection tool as well it would be
grand.
 
  Since you gave no clue which systems you are using, it's hard to suggest anything.



- --
jimoe at sohnen-moe dot com
pgp/gpg public key: http://www.keyserver.net/en/
-BEGIN PGP SIGNATURE-
Version: PGPfreeware 5.0 OS/2 for non-commercial use
Comment: PGP 5.0 for OS/2
Charset: cp850

wj8DBQE+1EC9sxxMki0foKoRAlrLAJ0dcg2Wf4qyNW4dkmaIDc1IDB7wKwCgnmOA
qSjWb8sEhPA2mOypLz53+zw=
=a3p6
-END PGP SIGNATURE-



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]