How can I make and execute .sql file

How can I make and execute .sql file

Post by Jenny Chris » Wed, 17 Jul 2002 15:14:54



Hello All,

Can anybody tell me the query or procedure by which i
can generate the .sql file. So that I dont need to
write the query again and again on prompt.

Just by executing the .sql file(or script language), I
will able to create table, insert the data on table,
update the data..means whatever operation i need i can
write on it.

Plz help me to make it.

Rgds,
jenny

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How can I make and execute .sql file

Post by Egor Egor » Wed, 17 Jul 2002 18:29:27


Jenny,

JC> Can anybody tell me the query or procedure by which i
JC> can generate the .sql file. So that I dont need to
JC> write the query again and again on prompt.

JC> Just by executing the .sql file(or script language), I
JC> will able to create table, insert the data on table,
JC> update the data..means whatever operation i need i can
JC> write on it.

Create file which contains your SQL statements, f.e:

CREATE TABLE test(
       id int primary key
       );
INSERT INTO test VALUES (1),(2),(3);
SELECT * FROM test;

and then run mysql in batch mode:
    mysql database_name < test.sql

Look at:
    http://www.mysql.com/doc/B/a/Batch_mode.html

--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov

/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How can I make and execute .sql file

Post by Richard Dav » Wed, 17 Jul 2002 19:17:55



> Hello All,

> Can anybody tell me the query or procedure by which i
> can generate the .sql file. So that I dont need to
> write the query again and again on prompt.

> Just by executing the .sql file(or script language), I
> will able to create table, insert the data on table,
> update the data..means whatever operation i need i can
> write on it.

> Plz help me to make it.

> Rgds,
> jenny


r

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

How can I make and execute .sql file

Post by Jay Blanchar » Wed, 17 Jul 2002 21:50:41


[snip]
Can anybody tell me the query or procedure by which i
can generate the .sql file. So that I dont need to
write the query again and again on prompt.
[/snip]

Create a text file containing your query commands and then save it as
filename.sql (calling it whatever you wish of course) and then call that
text file from the command line.

HTH!

Jay
sql, mysql, query

"Watch out for the idiot behind me"

*************************************
* Want to meet other PHP developers *
* in your area? Check out:          *
* http://php.meetup.com/            *
* No developer is an island ...     *
*************************************

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 
 

1. Execute a file containing a sql script

Hi,

I'm a beginner in MySQL (also in english) so sorry for my uninterristing
questions.

I've installed MySQL 3.23.43 on a Linux RedHat 7.0 system, and it seems to
work normally.

How to execute a sql script which is inclus in a text file (ex : script.sql)
?

Thank you for your answers.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)



Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

2. R260 needs repair - suggestions?

3. Execute Sql File through Java

4. Manual Feed on HP DJ500

5. mysql CLI: executing SQL from a file

6. Correct smb.conf for cdrom share?

7. How to execute sql commands from a file?

8. To enter GNMAs & FNMAs?

9. Executing SQL commands in script files ...sorry ..mail was emty..

10. Executing SQL commands in script files

11. Executing SQL batch file

12. Making sure a database script is executed

13. AND on a many to many table, with arbitrary ANDs