Structure copy...

2002-01-30 Thread Vasoczki Ferenc

Hi, i want to copy a table structure.
I saw on the archive, there is a syntax like:
create [newtable] select * from [sourcetable] where 1=2;

This is not work on my MySQL server v.3.22
Is it a 3.23 feature, or am i do something wrong ?

If you know the solution please tell me that.
Thx

Vaso

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

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Structure copy...

2002-01-30 Thread Paul DuBois

At 17:29 +0100 1/30/02, Vasoczki Ferenc wrote:
Hi, i want to copy a table structure.
I saw on the archive, there is a syntax like:
create [newtable] select * from [sourcetable] where 1=2;

This is not work on my MySQL server v.3.22
Is it a 3.23 feature, or am i do something wrong ?

It's a 3.23 feature.


If you know the solution please tell me that.
Thx

Vaso

You may be able to use the output from mysqldump --no-data db_name tbl_name,
which will produce the CREATE TABLE statement for the table.  Do a substitution
to change the name in the statement, then execute it.

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

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Structure copy...

2002-01-30 Thread Vasoczki Ferenc

Yes, just i need to make it from code, and from a windows machine, so i cant
use shell() or something like that...
So i need to upgrade...

Vaso

-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: 2002. janur 30. 19:31
To: Vasoczki Ferenc; '[EMAIL PROTECTED]'
Subject: Re: Structure copy...


At 17:29 +0100 1/30/02, Vasoczki Ferenc wrote:
Hi, i want to copy a table structure.
I saw on the archive, there is a syntax like:
create [newtable] select * from [sourcetable] where 1=2;

This is not work on my MySQL server v.3.22
Is it a 3.23 feature, or am i do something wrong ?

It's a 3.23 feature.


If you know the solution please tell me that.
Thx

Vaso

You may be able to use the output from mysqldump --no-data db_name tbl_name,
which will produce the CREATE TABLE statement for the table.  Do a
substitution
to change the name in the statement, then execute it.

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

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php