Gossamer Forum
Home : Products : DBMan SQL : Discussion :

select_options and query_sth

Quote Reply
select_options and query_sth
I have 3 questions about the following code -

(taken from sub modify_search_results in Dbsql/Home.pm )

1/ Can $obj->select_options be applied to $obj->query_sth in the code below or is it only used with $obj->select???

2/ After reading up on GROUP BY it appears that whatever columns are in the SELECT must also be in the GROUP BY. Does this mean that $obj->query_sth automatically selects only the columns named in the GROUP BY or does it select all columns by default??? If it selects all columns then the GROUP BY would not be reliable.

3/ (If the answer to question 1 is "NO") How can I impliment the GROUP BY into $obj->query_sth???

my $group = "GROUP BY col1, col2";
$self->{db}->select_options($group);


# Do the search and count the results.
my $sth = $self->{db}->query_sth ($self->{cgi}) or return $self->modify_search_form($GT::SQL::error);


Thank you.

Simon.
Subject Author Views Date
Thread select_options and query_sth jai 8573 Feb 24, 2003, 7:34 PM
Thread Re: [jai] select_options and query_sth
jean 8375 Feb 26, 2003, 11:14 AM
Thread Re: [jean] select_options and query_sth
jai 8354 Feb 27, 2003, 3:08 AM
Thread Re: [jai] select_options and query_sth
jai 8340 Mar 3, 2003, 9:47 PM
Thread Re: [jai] select_options and query_sth
jai 8295 Mar 7, 2003, 3:16 PM
Post Re: [jai] select_options and query_sth
jai 8262 Mar 11, 2003, 3:58 PM
Thread Re: [jai] select_options and query_sth
jean 8247 Mar 11, 2003, 4:39 PM
Thread Re: [jean] select_options and query_sth
jai 8260 Mar 11, 2003, 9:32 PM
Thread Re: [jai] select_options and query_sth
jean 8241 Mar 12, 2003, 12:05 AM
Thread Re: [jean] select_options and query_sth
jai 8200 Mar 17, 2003, 6:08 AM
Thread Re: [jai] select_options and query_sth
jean 8211 Mar 17, 2003, 2:46 PM
Thread Re: [jean] select_options and query_sth
jai 8189 Mar 17, 2003, 3:15 PM
Post Re: [jai] select_options and query_sth
rgbworld 7769 May 22, 2005, 3:44 PM