|
|
|
Next: handle no data found situation
|
| Author |
Message |
External

Since: Apr 18, 2007 Posts: 2
|
(Msg. 1) Posted: Wed Jun 20, 2007 7:41 am
Post subject: creating table for rails Archived from groups: mailing>database>mysql (more info?)
|
|
|
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 |
|
| Back to top |
|
 |  |
External

Since: Nov 10, 2006 Posts: 249
|
(Msg. 2) Posted: Wed Jun 20, 2007 6:17 pm
Post subject: Re: creating table for rails Archived from groups: per prev. post (more info?)
|
|
|
On Wed, 20 Jun 2007 07:41:01 GMT, in mailing.database.mysql Thufir
<hawat.thufir.DeleteThis@gmail.com>
<hS4ei.40861$NV3.16873@pd7urf2no> wrote:
>| 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.DeleteThis@yourpantsyahoo.com.au : Remove your pants to reply
--------------------------------------------------------------- |
|
| Back to top |
|
 |  |
External

Since: Jun 21, 2007 Posts: 1
|
(Msg. 3) Posted: Thu Jun 21, 2007 4:30 am
Post subject: Re: creating table for rails Archived from groups: per prev. post (more info?)
|
|
|
On Jun 20, 7:17 pm, Jeff North <jnort....TakeThisOut@yahoo.com.au> wrote:
> On Wed, 20 Jun 2007 07:41:01 GMT, in mailing.database.mysql Thufir
> <hawat.thu....TakeThisOut@gmail.com>
>
> <hS4ei.40861$NV3.16873@pd7urf2no> wrote:
> >| 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 |
|
| Back to top |
|
 |  |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|