MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 29th, 2012, 04:41 PM
Paul Maitland Paul Maitland is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 Paul Maitland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 57 sec
Reputation Power: 0
MySQL script/encoding/command line problem

I would love for someone more knowledgeable than me to point out what the %¤&/ I am doing wrong trying to test an MySQL script on the command line:

Code:
drop database movies; 
create database movies;

use movies;
create table movie (
	id int not null auto_increment,
	title varchar(50),
	year int,
	price decimal(8,2),
	primary key(id)
);

insert into movie (title,year,price) values (”The Great Race”, 1965, 12.95);


Completely irrespectively of what I do, no matter which file format I try to store the script in, no matter which encoding I attempt, I always get the same error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'öThe Great Raceö, 1965, 12.95)' at line 1

Of course, the 'ö' can be traded for a number of other erroneous characters depending on the file format/encoding of the source file, but never the right one, double quotation marks as in the source file itself.

Big up to anyone who can his provide any answers or pointers to where I can read up on this specific problem.

Reply With Quote
  #2  
Old December 29th, 2012, 06:53 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,375 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 7 h 28 m 3 sec
Reputation Power: 4140
the error message points to exactly what's wrong -- the microsoft smart quotes, ” = hex 94 (dec 148)

those are not the same as double quotes, which are " = hex 22 (dec 34)

in any case, you should be using single quotes, ' = hex 27 (dec 39)

only mysql allows using the double quote to delimit character strings, standard sql and all other database systems prefer the single quote
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old December 30th, 2012, 11:44 AM
Paul Maitland Paul Maitland is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 Paul Maitland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 57 sec
Reputation Power: 0
Thanks 1,000,000, r937.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > MySQL script/encoding/command line problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap