You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Joerg Jaspert <mo...@german.ath.cx> on 2002/03/05 18:43:39 UTC
DBIx::Recordset and Select with $order
Hi
If i have
*set = DBIx::Recordset->Select(
{'!DataSource' => $dsn,
'!Table' => 'config',
'!Username' => $user,
'!Password' => $pass,
'$order' => 'id'});
it wont work. If i only change Select to Search it works. But in
perldoc DBIx::Recordset its documented that only Select works with
order.
--
begin OjE-ist-scheisse.txt
bye, Joerg
Registered Linux User #97793 @ http://counter.li.org
end
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: DBIx::Recordset and Select with $order
Posted by Joerg Jaspert <em...@german.ath.cx>.
"Gerald Richter" <ri...@ecos.de> writes:
> No, according to that documentation your example has to be written as
> *set = DBIx::Recordset->Select(
> {'!DataSource' => $dsn,
> '!Table' => 'config',
> '!Username' => $user,
> '!Password' => $pass}, undef, 'id');
> again, order is the third parameter to Select and _not_ a part of the
> parameter hash.
Uups, öhm. I see the difference. Hmmpf i should read the docs more careful.
> Hopefully it's more clear now
Yes, thx.
> P.S. You asked on the embperl mailing list, but answered on the modperl
> list. I CC it to both...
Hmm, something strange happened with my filter. All mails sorted to the
Modperl-Archiv. Sorry.
--
begin OjE-ist-scheisse.txt
bye, Joerg
Registered Linux User #97793 @ http://counter.li.org
end
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: DBIx::Recordset and Select with $order
Posted by Gerald Richter <ri...@ecos.de>.
>
> In my perldoc DBIx::Recorset there is:
>
> *set = DBIx::Recordset -> Select (\%params, $fields, $order)
> $set -> Select (\%params, $fields, $order)
> $set -> Select ($where, $fields, $order)
> Selects records from the recordsets table(s).
> [...]
> order: comma separated list of fieldnames to sort on
>
> *set = DBIx::Recordset -> Search (\%params)
> [nothing with $order here]
>
> So the Documentation is *very* wrong. :)
No, according to that documentation your example has to be written as
*set = DBIx::Recordset->Select(
{'!DataSource' => $dsn,
'!Table' => 'config',
'!Username' => $user,
'!Password' => $pass}, undef, 'id');
again, order is the third parameter to Select and _not_ a part of the
parameter hash.
> (Yes, in the Examples Part $order is only used with Search, but i dont
> look there very often. :) )
>
It's mentioned under "Search parameters", as I wrote in my privious mail:
Search parameters
$start
First row to fetch. The row specified here will appear as index 0 in the
data array.
[..]
$order
Fieldname(s) for ordering (ORDER BY) (must be comma-separated, could
also contain USING)
Since Search (and other methods) can take the same parameters, the parameter
are grouped together in the documentation by type.
Hopefully it's more clear now
Gerald
P.S. You asked on the embperl mailing list, but answered on the modperl
list. I CC it to both...
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: DBIx::Recordset and Select with $order
Posted by Gerald Richter <ri...@ecos.de>.
>
> In my perldoc DBIx::Recorset there is:
>
> *set = DBIx::Recordset -> Select (\%params, $fields, $order)
> $set -> Select (\%params, $fields, $order)
> $set -> Select ($where, $fields, $order)
> Selects records from the recordsets table(s).
> [...]
> order: comma separated list of fieldnames to sort on
>
> *set = DBIx::Recordset -> Search (\%params)
> [nothing with $order here]
>
> So the Documentation is *very* wrong. :)
No, according to that documentation your example has to be written as
*set = DBIx::Recordset->Select(
{'!DataSource' => $dsn,
'!Table' => 'config',
'!Username' => $user,
'!Password' => $pass}, undef, 'id');
again, order is the third parameter to Select and _not_ a part of the
parameter hash.
> (Yes, in the Examples Part $order is only used with Search, but i dont
> look there very often. :) )
>
It's mentioned under "Search parameters", as I wrote in my privious mail:
Search parameters
$start
First row to fetch. The row specified here will appear as index 0 in the
data array.
[..]
$order
Fieldname(s) for ordering (ORDER BY) (must be comma-separated, could
also contain USING)
Since Search (and other methods) can take the same parameters, the parameter
are grouped together in the documentation by type.
Hopefully it's more clear now
Gerald
P.S. You asked on the embperl mailing list, but answered on the modperl
list. I CC it to both...
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: DBIx::Recordset and Select with $order
Posted by Joerg Jaspert <mo...@german.ath.cx>.
"Gerald Richter" <ri...@ecos.de> writes:
>> But in perldoc DBIx::Recordset its documented that only Select works with
>> order.
> It only works with Search. $order is listed below the heading "Search
> parameters", while Select has an extra parameter (the third one) for order.
> Anyway it's better to use Search, because Select is very limited.
In my perldoc DBIx::Recorset there is:
*set = DBIx::Recordset -> Select (\%params, $fields, $order)
$set -> Select (\%params, $fields, $order)
$set -> Select ($where, $fields, $order)
Selects records from the recordsets table(s).
[...]
order: comma separated list of fieldnames to sort on
*set = DBIx::Recordset -> Search (\%params)
[nothing with $order here]
So the Documentation is *very* wrong. :)
(Yes, in the Examples Part $order is only used with Search, but i dont
look there very often. :) )
--
begin OjE-ist-scheisse.txt
bye, Joerg
Registered Linux User #97793 @ http://counter.li.org
end
Re: DBIx::Recordset and Select with $order
Posted by Gerald Richter <ri...@ecos.de>.
> But in
> perldoc DBIx::Recordset its documented that only Select works with
> order.
>
It only works with Search. $order is listed below the heading "Search
parameters", while Select has an extra parameter (the third one) for order.
Anyway it's better to use Search, because Select is very limited.
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org