hi, to run a sql script from mysql shell just use command "source
your_sql_script.sql"
if you want to run it directly from prompt use this

mysql --force -uusername -ppassword -e"source your_sql_script.sql"



----- Original Message -----
From: "Seena Blace" <[EMAIL PROTECTED]>
To: "Remko Lodder" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 11:10 PM
Subject: HOW TO RUN SQL


> how to run sql script like
> if i have mysql prompt
> mysql >
> at above prompt I want to run sql script. how to do this? what will be
extenstion of file?
>
> Remko Lodder <[EMAIL PROTECTED]> wrote:
> mysql -p
>  -u -e
>
> that can be runned from any shell script.
>
> use enum to check Y/N TRUE/FALSE etc.
>
> CREATE TABLE testtest (
> test ENUM( 'TRUE', 'FALSE' ) NOT NULL
> );
>
>
> it automaticly sets true as default value with me.
> otherwise add:
>
> DEFAULT 'FALSE'
>
> after not null
>
> Hope this helps
> --
>
> Kind regards,
>
> Remko Lodder
> Elvandar.org/DSINet.org
> www.mostly-harmless.nl Dutch community for helping newcomers on the
> hackerscene
> mrtg.grunn.org Dutch mirror of MRTG
>
> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Seena Blace
> Verzonden: maandag 9 februari 2004 22:14
> Aan: [EMAIL PROTECTED]
> Onderwerp: [Mysql-discussions] HOW TO RUN SQL and default value ?
>
>
> Hi,
> How to run script at mysql prompt?
> Like if i want to create a table or select some query and I want to put
> those sql statement into one file ,how to run that and what would be the
> extention of that query?
> I want to create on column which contains only default value TRUE or
> False.how to do that?
> Create table test1 (no int, flag char (6) default ...................
> thx -seena
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to