Generate SQL Statements

Started by Terry Lee Tuckeralmost 18 years ago3 messagesgeneral
Jump to latest
#1Terry Lee Tucker
terry@chosen-ones.org

Greetings:

I was wondering if anyone knows of a third party product that will generate
SQL statements for creating existing tables. We have to provide table
definition statements for out parent company. Any ideas?
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com

#2Steve Crawford
scrawford@pinpointresearch.com
In reply to: Terry Lee Tucker (#1)
Re: Generate SQL Statements

Terry Lee Tucker wrote:

Greetings:

I was wondering if anyone knows of a third party product that will generate
SQL statements for creating existing tables. We have to provide table
definition statements for out parent company. Any ideas?

Why 3rd party? How about:

pg_dump --schema-only -t table_name... ?

Alternately, roll-your-own using the system tables. A good place to
start is by running psql with the --echo-queries option to see the
queries it runs "behind the scenes". You can read the queries for things
like "\d+ tablename" then modify them to suit.

Cheers,
Steve

#3Terry Lee Tucker
terry@chosen-ones.org
In reply to: Steve Crawford (#2)
Re: Generate SQL Statements

On Tuesday 03 June 2008 20:10, Steve Crawford wrote:

Terry Lee Tucker wrote:

Greetings:

I was wondering if anyone knows of a third party product that will
generate SQL statements for creating existing tables. We have to provide
table definition statements for out parent company. Any ideas?

Why 3rd party? How about:

pg_dump --schema-only -t table_name... ?

Alternately, roll-your-own using the system tables. A good place to
start is by running psql with the --echo-queries option to see the
queries it runs "behind the scenes". You can read the queries for things
like "\d+ tablename" then modify them to suit.

Cheers,
Steve

Now why didn't I think of that :o/

Thanks for the help...
--
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987
terry@turbocorp.com
www.turbocorp.com