Click here to get back home

creating table for rails

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
creating table for rails Thufir 06-20-2007
Get Chitika Premium
Posted by Thufir on June 20, 2007, 3:41 am
Please log in for more thread options
I'm working from <http://www.oracle.com/technology/pub/articles/haefel-
oracle-ruby.html>, would like to adapt the SQL for MySQL, please. Yes, I
know, that's oracle wheras I'm using MySQL. This website happens to be
the best rails tutorial I can find for my purposes, and I'd like to
follow along with it.

Here's what's happening:



[thufir@localhost ~]$
[thufir@localhost ~]$ mysql -u feeds -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 20 to server version: 5.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
mysql>
mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| Comic |
| Legacy |
| dummy |
| dummy_development |
| feeds |
| mysql |
| test |
+--------------------+
8 rows in set (0.01 sec)

mysql>
mysql> use Comic;
Database changed
mysql>
mysql> show tables;
Empty set (0.00 sec)

mysql>
mysql> CREATE TABLE comics (
-> idNUMBER(10) NOT NULL,
-> titleVARCHAR2(60),
-> issueNUMBER(4),
-> publisherVARCHAR2(60),
-> PRIMARY KEY (id)
-> );
ERROR 1064 (42000): 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 '(10) NOT NULL,
titleVARCHAR2(60),
issueNUMBER(4),
publisherVARCHAR2(60),
PRIMARY' at line 2
mysql>
mysql> quit
Bye
[thufir@localhost ~]$
[thufir@localhost ~]$ date
Wed Jun 20 08:36:58 BST 2007
[thufir@localhost ~]$
[thufir@localhost ~]$




thanks,

Thufir


Posted by Jeff North on June 20, 2007, 2:17 pm
Please log in for more thread options
On Wed, 20 Jun 2007 07:41:01 GMT, in mailing.database.mysql Thufir

>| I'm working from <http://www.oracle.com/technology/pub/articles/haefel-
>| oracle-ruby.html>, would like to adapt the SQL for MySQL, please. Yes, I
>| know, that's oracle wheras I'm using MySQL. This website happens to be
>| the best rails tutorial I can find for my purposes, and I'd like to
>| follow along with it.
>|
>| Here's what's happening:
[snip]

>| mysql> CREATE TABLE comics (
>| -> idNUMBER(10) NOT NULL,
>| -> titleVARCHAR2(60),
>| -> issueNUMBER(4),
>| -> publisherVARCHAR2(60),
>| -> PRIMARY KEY (id)
>| -> );

CREATE TABLE comics (
id int(10) NOT NULL,
title varchar(60),
issue smallint(4),
publisher varchar(60),
PRIMARY KEY (id)
) ENGINE=MyISAM;

>| ERROR 1064 (42000): 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 '(10) NOT NULL,
>| titleVARCHAR2(60),
>| issueNUMBER(4),
>| publisherVARCHAR2(60),
>| PRIMARY' at line 2
>| mysql>
>| mysql> quit

[snip]
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------

Posted by Thufir on June 21, 2007, 12:30 am
Please log in for more thread options
> On Wed, 20 Jun 2007 07:41:01 GMT, in mailing.database.mysql Thufir
>
> >| I'm working from <http://www.oracle.com/technology/pub/articles/haefel-
> >| oracle-ruby.html>, would like to adapt the SQL for MySQL, please.
[...]
> CREATE TABLE comics (
> id int(10) NOT NULL,
> title varchar(60),
> issue smallint(4),
> publisher varchar(60),
> PRIMARY KEY (id)
> ) ENGINE=MyISAM;
[...]


thanks :)


-Thufir


Similar ThreadsPosted
Creating user error June 25, 2005, 2:56 pm
Creating an unique record id ?? October 9, 2005, 1:15 pm
Creating queries for one-to-many tables December 11, 2005, 10:02 pm
creating foreign fields January 22, 2006, 12:25 pm
Creating an A to Z list from query February 9, 2006, 9:56 am
Creating my own Data dictionary April 21, 2006, 9:48 pm
creating a url distribution report June 23, 2006, 7:26 pm
Creating FUNCTIONS/PROCEEDURES September 16, 2006, 5:00 pm
Creating a hyperlink to a specific record January 9, 2006, 2:05 pm
Creating ordered lists that ignore the word 'The' at the start of phrases December 22, 2005, 9:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap