Guruza search results for sql http://guruza.com/searches/show/31 Questions recently submitted to Guruza that match the query: sql Thu, 20 Nov 2008 14:12:28 -0800 $5.00 - What is the best automated way to keep a hosted MS SQL server in sync with an... http://guruza.com/question/435/reward-5.00 What is the best automated way to keep a hosted MS SQL server in sync with another hosted SQL server at a different web host? My host doesn't support replication (e.g. publishing). I'm primarily interested in doing this to allow me to failover to another server at another host if our site goes down. Sat, 28 Oct 2006 10:51:48 -0700 $10.00 - Is there any way I can use find_by_sql AND eager load associations? I have t... http://guruza.com/question/393/reward-10.00 Is there any way I can use find_by_sql AND eager load associations? I have to return everything in 1 sql statement, but I would still like to access associations normally when outputting in my rhtml file. Mon, 11 Sep 2006 16:58:34 -0700 $10.00 - Can someone please help with this odd error? It appears that rails is not pa... http://guruza.com/question/245/reward-10.00 Can someone please help with this odd error? It appears that rails is not parsing the url correctly. However, browsing to the url http://guruza.com/question/244/0.0/523#comment_537 does not replicate the error A ActiveRecord::StatementInvalid occurred in question#index: PGError: ERROR: invalid input syntax for integer: "523#comment_537" : SELECT * FROM conversations WHERE (conversations."id" = '523#comment_537' ) LIMIT 1 /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log' ------------------------------- Request: ------------------------------- * URL: http://guruza.com/question/244/0.0/523#comment_537 * Parameters: {"action"=>"index", "reward"=>"0.0", "conversation_id"=>"523#comment_537", "id"=>"244", "controller"=>"question"} * Rails root: /var/www/guruza ------------------------------- Session: ------------------------------- * @write_lock: true * @session_id: **HIDDEN** * @new_session: false * @data: {:request_data=> {:request_uri=>"/question/244/0.0/523#comment_537", :raw_post=>nil}, "flash"=>{}} ------------------------------- Environment: ------------------------------- * DOCUMENT_ROOT : **HIDDEN** * FCGI_ROLE : RESPONDER * GATEWAY_INTERFACE : CGI/1.1 * HTTP_ACCEPT : text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 * HTTP_ACCEPT_CHARSET : ISO-8859-1,utf-8;q=0.7,*;q=0.7 * HTTP_ACCEPT_ENCODING: gzip * HTTP_ACCEPT_LANGUAGE: es * HTTP_COOKIE : **HIDDEN** * HTTP_HOST : guruza.com * HTTP_REFERER : http://guruza.com/ * HTTP_USER_AGENT : Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 * HTTP_X_FORWARDED_FOR: 83.41.203.33 * HTTP_X_MOZ : prefetch * PATH_INFO : * QUERY_STRING : * REDIRECT_STATUS : 200 * REDIRECT_URI : /dispatch.fcgi * REMOTE_ADDR : **HIDDEN** * REMOTE_PORT : 48682 * REQUEST_METHOD : GET * REQUEST_URI : /question/244/0.0/523#comment_537 * SCRIPT_FILENAME : /var/www/guruza/public/dispatch.fcgi * SCRIPT_NAME : /dispatch.fcgi * SERVER_ADDR : 66.220.26.12 * SERVER_NAME : guruza.com * SERVER_PORT : 80 * SERVER_PROTOCOL : HTTP/1.1 * SERVER_SOFTWARE : lighttpd/1.4.10 * Process: 15875 * Server : ------------------------------- Backtrace: ------------------------------- /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:148:in `execute' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:362:in `select' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:129:in `select_all' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:390:in `find_by_sql' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:924:in `find_every' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:918:in `find_initial' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1103:in `method_missing' [RAILS_ROOT]/app/controllers/question_controller.rb:21:in `index' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in `perform_action_with_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_with_benchmark' /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_with_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in `perform_action_with_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in `process_with_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process_with_session_management_support' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in `process!' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in `each_cgi' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in `process!' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in `process!' [RAILS_ROOT]/public/dispatch.fcgi:24 Sun, 16 Jul 2006 15:09:06 -0700 $0.00 - Hey Rich, What happened to your previous question...it *seems* like it got... http://guruza.com/question/240/reward-0.00 Hey Rich, What happened to your previous question...it *seems* like it got answered by besquared, but the answer does not show up at all. It looks like maybe only the tail end of the chat log was saved. At any rate (even though you may not need the answer any more), here's how I would have done it: First, in the find function, you use userid, but there is no userid field in user. Thus, the two places where you have userid should be prefixed with posts., as in posts.userid If that doesn't work, I'd go straight to SQL using the find_by_sql function: Users.find_by_sql "SELECT u.*, count(p.userid) postcount FROM users u, posts p WHERE p.userid = u.id GROUP BY p.userid ORDER BY postcount" Fri, 14 Jul 2006 01:54:28 -0700 $10.00 - I have the following table: posts id votes id type (either 'up... http://guruza.com/question/238/reward-10.00 I have the following table: posts id votes id type (either 'up' or 'down') created_at I want to do things like this: order the posts by up votes - down votes order the posts by up votes - down votes in the last hour I would like to use SQL that will work cross platform I could do something like this: select posts.* from posts order by (select count(*) from votes where type = 'up' and post_id = posts.id) - (select count(*) from votes where type = 'down' and post_id = posts.id) but that seems pretty ugly and unlikely to work cross platform Any suggestions? Thu, 13 Jul 2006 18:17:26 -0700 $10.00 - I have a small business lan that is composed of a D-link Router, and 2 hubs. ... http://guruza.com/question/237/reward-10.00 I have a small business lan that is composed of a D-link Router, and 2 hubs. Both hubs are plugged directly in the router using their uplink ports. The computers plugged in hub #1 can connect to SQL Server (using a username and password, not Windows Authentication) just fine, but the ones connected to the second hub can't. I get a "Server doesn't exist or access denied" error. I use the same connection string, username and password. Of course, the computers on the second hub can access the network, internet and so on. I can even ping the server from them, but for whatever reason, I can't connect to Sql Server! What could it be? I'm a little lost now... Thu, 13 Jul 2006 10:26:10 -0700 $50.00 - We need a performance monitoring solution that will tell us if something is a... http://guruza.com/question/224/reward-50.00 We need a performance monitoring solution that will tell us if something is amiss with the site. The answer that provides the most comprehensive discussion of various solutions and which one is recommended (and why) will win the reward. Wed, 05 Jul 2006 11:49:44 -0700 $5.00 - What support does ruby have for internationalization? I have heard that ruby ... http://guruza.com/question/167/reward-5.00 What support does ruby have for internationalization? I have heard that ruby on rails doesn't support a large amount of character sets. I am in the midst of rolling out a international application and need to ofcourse make sure that rails can support every character set possible. Some I need initially are UTF8, Big 5, Shift JIS. Can rails handle this? Fri, 30 Jun 2006 07:19:54 -0700 $10.00 - How is a DSL (Domain Specific Language) different from an API (Application Pr... http://guruza.com/question/120/reward-10.00 How is a DSL (Domain Specific Language) different from an API (Application Programming Interface)? Can someone point me to some examples? Tue, 27 Jun 2006 16:45:24 -0700 $10.00 - What is the best way to write a simple sql statement that groups on one colum... http://guruza.com/question/119/reward-10.00 What is the best way to write a simple sql statement that groups on one column and uses the first value located on the other columns? ex:table users: id, email, name, passwordtable posts: user_id, title, bodySELECT users.*, COUNT(users.id) as post_countFROM users, postsWHERE users.id = posts.user_idGROUP BY users.idORDER BY post_countThis will not work as you must include each user column in an aggregate function or in the group by clause. My actual table has many fields and I don't want to specify each column. Tue, 27 Jun 2006 15:37:29 -0700