How do I run SQL script?

2,716 views
Skip to first unread message

Nelson

unread,
Feb 15, 2012, 9:26:55 PM2/15/12
to Sequel Pro
Is it possible? If so, how?

Jeremy Burns | Class Outfit

unread,
Feb 16, 2012, 3:46:30 AM2/16/12
to seque...@googlegroups.com
Go to the 'Query' tab.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 16 Feb 2012, at 02:26:55, Nelson wrote:

Is it possible? If so, how?

--
You received this message because you are subscribed to the Google Groups "Sequel Pro" group.
To post to this group, send email to seque...@googlegroups.com.
To unsubscribe from this group, send email to sequel-pro+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sequel-pro?hl=en.


Rowan Beentje

unread,
Feb 16, 2012, 5:50:55 AM2/16/12
to seque...@googlegroups.com
As well as Jeremy's suggestion of the Query tab, if you have a script on disk, you can use File > Import to run all the commands in it directly.

On 16 Feb 2012, at 02:26, Nelson wrote:

> Is it possible? If so, how?
>

Nelson

unread,
Feb 16, 2012, 8:28:06 AM2/16/12
to Sequel Pro, ro...@beent.je, jerem...@classoutfit.com
Thanks, clearly it's my first time. I'm trying to make a basic table
for a class and I typed in this example

CREATE TABLE Orders
(
CustomerID INTEGER NOT NULL,
PlanID CHAR(10) NOT NULL,
OrderDate DATETIME NOT NULL,
CancelationDate DATETIME
);

But I keep getting the error:

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 'MONEY NOT NULL,
DiscountedPrice MONEY
)' at line 6


On Feb 16, 3:46 am, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
> Go to the 'Query' tab.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 16 Feb 2012, at 02:26:55, Nelson wrote:
>
>
> tr

Nelson Spencer

unread,
Feb 16, 2012, 8:30:09 AM2/16/12
to seque...@googlegroups.com, ro...@beent.je, jerem...@classoutfit.com
Sorry that was the wrong table.  This is what led to the error:

CREATE TABLE ServicePlans 

PlanID CHAR(10) PRIMARY KEY NOT NULL, 
PlanName CHAR(50) NOT NULL, 
PlanDescription CHAR(50) NOT NULL, 
PlanPrice MONEY NOT NULL, 
DiscountedPrice MONEY
);

Rowan Beentje

unread,
Feb 16, 2012, 8:33:38 AM2/16/12
to seque...@googlegroups.com
Nelson,

MySQL doesn't support the "Money" type. Are you trying to use instructions intended for PostgreSQL or another database type?

There's also probably better places to ask general MySQL query syntax questions - this list is really intended for stuff related to this particular GUI :)

Rowan

Jeremy Burns | Class Outfit

unread,
Feb 16, 2012, 8:43:56 AM2/16/12
to seque...@googlegroups.com
Use:

`PlanPrice` decimal(7,2) NOT NULL DEFAULT '0.00',

(7,2) will allow 7 significant numbers with 2 decimal places, so ##,###.##


Jeremy Burns

Reply all
Reply to author
Forward
0 new messages