Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL to Oracle text field insert statement

Status
Not open for further replies.

rajeshgooner

IS-IT--Management
Feb 3, 2004
31
0
0
GB
New to oracle. A very simple question I reckon. I'm migrating some data from mySQL to oracle 9i database. Trying to do this without using any of the migration tools at the moment.

MySQL
Table Name: Content
Field: summary
Value: Here is the guide to make paper throwing stars. They are nice, don\'t fall apart easily (if made well) and can be thrown far (if thrown well). Read on.

The insert statement for mySQL would be:

insert into "content" ("summary") values
('Here is the guide to make paper throwing stars. They are nice, don\'t fall apart easily (if made well) and can be thrown far (if thrown well). Read on.')

If I want to insert this into Oracle:

1. What should the corresponding field datatype be? I'm thinking varchar2(2000).
2. How would I write the insert statement as the text has a single quote in it..

Thanks in advance
 
You may use VARCHAR2 or CLOB but the reason for choosing 2000 (not 4000 or 100 or any other valid number) is not clear for me :)
Code:
insert into "content" ("summary") values('Here is the guide to make paper throwing stars. They are nice, don[b]''[/b]t fall apart easily (if made well) and can be thrown far (if thrown well). Read on.')

Regards, Dima
 
Only reason for using 2000 is what I had read that the limit for varchar2 was (0-2000). if 4000 then I will change it.

btw, thanks for the insert statement, using the two single quote marks in the "don't" seems to work!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top