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: Writing a SQL Query in Active Record?
by Phillip Gawlowski other posts by this author
May 8 2008 10:40AM messages near this date
Re: Writing a SQL Query in Active Record? | integers with preceding zero don't return as expected?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anukul Singhal wrote:


| I am not using rails. Want to run the query only using Active Record on
| Ruby (Scite Editor)

Yes, that is what ActiveRecord's #find and #find_by_sql methods do.

Rails uses ActiveRecord, but ActiveRecord works without using Rails itself.

| Can you give any prototype as to how I can proceed writing a simple
| "SELECT" query after establishing the connection with the sql server db?

class Table < ActiveRecord::Base; end

select = Table.find :all

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

~   How many boards would the Mongols hoard if the Mongol hordes got bored?
		  -- Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgjOwUACgkQbtAgaoJTgL8NVQCgpLIP+PbwTxDnEhXiXDg3sLlc
gy0An3GewesORQjT2Q7uQlvbEpUuRyi4
=8Svr
-----END PGP SIGNATURE-----
Thread:
Anukul Singhal
Phillip Gawlowski
Simon Krahnke
Phillip Gawlowski
Anukul Singhal
Phillip Gawlowski

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