search for: other_table

Displaying 4 results from an estimated 4 matches for "other_table".

2007 Aug 30
1
belongs_to with foreign keys that reference non primary key columns
Hello, I have a situation where the foreign key into a table doesn''t correspond to that table''s primary key: my_table ------------- id (pk) name ... other_table -------------- id (pk) my_table_name (fk references my_table(name)) ... I want to be able to say something like: class OtherTable < ActiveRecord::Base belongs_to :my_table, :foreign_key => { :my_table_name => :name } end OtherTable.find(:first).my_table Is this possible? If not, what...
2009 Sep 09
0
Query result is array of elements, how to iterate over it ??
...If I do something like : SELECT ID FROM my_table WHERE client=clientID AND set=yes and this query results in several rows and thus several ID's like "2 5 7 11 13 14 17"... How can I iterate over these values ?? Something like : for each item in ARRAY { SELECT asterisk_syntax FROM other_table WHERE dateID=$item } This query would result in something like *|*|7|may. How to iterate over an array of results ??? Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090909/23ff5dd1/attachment.h...
2008 Mar 31
1
database design help
Hi, I''m coding a little application to make couples profile. The problem is I just don''t know how to create my databases so that their are no bottlenecks and that I can have a relation. The way I see it is that their would be a user database and a profile database and they would link 2 to 1. Is this the right way? In the user db I would store their userid and some session info,
2010 Jun 10
1
Can RMySQL be used for a paramterized query?
...the result. Perhaps the DBI could at some point in the future > implement > this feature. > I can connect, and execute a SQL query such as "SELECT id FROM my_table", and display a frame with all the IDs from my_table. But I need also to do something like "SELECT * FROM my_other_table WHERE t1_id = x" where 'x' is one of the IDs returned by the first select statement. Actually, I have to do this in two contexts, one where the data are not ordered by time and one where it is (and thus where I'd have to use TSMySQL to execute something like "SELECT record_d...