ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Re: Active Record: Query to find all the tables in a database?
by Prabhas Gupte other posts by this author
May 9 2008 4:50AM messages near this date
Active Record: Query to find all the tables in a database? | Re: Cookie Monster!
just for confirmation, do this:
con = ActiveRecord::Base.establish
> 
>  _connection(
>  :adapter => "sqlserver",
>  :host => "113.130.232.221,1342",
>  :username => "username",
>  :password => "password",
>  :database => "DIT_VW_1008"
>  )
> 

print con.methods

On Fri, May 9, 2008 at 3:02 PM, Anukul Singhal <anukul.singhal@[...].com> 
wrote:

>  Hi,
> 
>  I am using the following code snippet to connect to a DB using Active
>  Record:
> 
>  require 'rubygems'
>  require 'active_record'
> 
>  ActiveRecord::Base.establish_connection(
>  :adapter => "sqlserver",
>  :host => "113.130.232.221,1342",
>  :username => "username",
>  :password => "password",
>  :database => "DIT_VW_1008"
>  )
> 
>  It has about 25 tables. I want to print the names of all the tables in
>  the database "DIT_VW_1008". Can anyone provide the code to solve my
>  problem?
> 
>  Thanks,
>  Anukul
>  --
>  Posted via http://www.ruby-forum.com/.
> 
> 


-- 
Prabhas Gupte
Mob: +91 - 99 70 98 98 79
http://www.linkedin.com/in/prabhasgupte
Thread:
Anukul Singhal
Prabhas Gupte

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved