Re: [RDBO] Database Permissions when inserting (relationships).

2008-01-10 Thread Curon Davies
On Jan 9, 2008 20:02, John Siracusa <[EMAIL PROTECTED]> wrote: > In the meantime, you can always express more explicitly the operations > you intend to perform. For example: > > $product = My::DB::Product->new( > name => $^T, > add_prices => > [ > { price => 3.60, region => 'uk' }, >

Re: [RDBO] Database Permissions when inserting (relationships).

2008-01-10 Thread John Siracusa
On Jan 10, 2008 5:47 AM, Curon Davies <[EMAIL PROTECTED]> wrote: > Thanks for that suggestion, something that I didn't think about. The > add_ prefix doesn't look that nice in the constructor. Then don't put it in the constructor call :) $product = My::DB::Product->new(name => $^T); $product->add

[RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread James Masters
Rosers, Have a bit of trouble with a Manager query. Trying to keep it short and sweet, I am searching a table "orders" which has a onetoone relationship called destaddress. The first 3 queries here work: push @query, ('custlastname' => {like => '%smith%'}); push @query, ('destaddress.primecontac

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread John Siracusa
On 1/10/08 8:19 AM, James Masters wrote: > Have a bit of trouble with a Manager query. Trying to keep it short and > sweet, I am searching a table "orders" which has a onetoone relationship > called destaddress. The first 3 queries here work: > > push @query, ('custlastname' => {like => '%smith%'

Re: [RDBO] Database Permissions when inserting (relationships).

2008-01-10 Thread Curon Davies
Hi John. Thanks for your help on this. Unfortunately that still doesn't quite work. If we do: $product = My::DB::Product->new(name => $^T); $product->add_prices( { price => 3.60, region => 'uk' }, { price => 7.00, region => 'us' }, ); and then: my @prices = $product->prices;

Re: [RDBO] Database Permissions when inserting (relationships).

2008-01-10 Thread John Siracusa
On Jan 10, 2008 10:01 AM, Curon Davies <[EMAIL PROTECTED]> wrote: > Hi John. Thanks for your help on this. Unfortunately that still > doesn't quite work. If we do: > > $product = My::DB::Product->new(name => $^T); > $product->add_prices( > { price => 3.60, region => 'uk' }, > { price

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread James Masters
Dear John, I believe that I have a $spec{require_objects} = ['destaddress', ...] and this is working otherwise > push @query, ('destaddress.primecontact' => {like => '%smith%'}); wouldn't work. I know that a single 'or' element makes the 'or' redundant. I have other things in the 'or' but was

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread John Siracusa
On Jan 10, 2008 1:36 PM, James Masters <[EMAIL PROTECTED]> wrote: > I believe that I have a $spec{require_objects} = ['destaddress', ...] and > this is working otherwise > > > push @query, ('destaddress.primecontact' => {like => '%smith%'}); > > wouldn't work. [...] > > Anyway, your email implies

[RDBO] Too Many connections

2008-01-10 Thread James Masters
Another new odd thing happened today. Have a program that has worked fine for sometime but today it had to suck in more data than ever before and produced: Too many connections at C:/Perl/site/lib/Rose/DB.pm line 828 This seems to be a common error and simply means I've broken the default restric

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread James Masters
I don't think I'm going mad (but am usually proved wrong). Here is a test routine: sub gdb_get_orders_test { my $testspec1 = {require_objects => 'destaddress', query => ['destaddress.primecontact' => {like => '%smith%'}]}; my ($mysqlorders1, $mysqlerr1) = rose_get_orders($testspec1); print "Foun

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread John Siracusa
On 1/10/08 5:46 PM, James Masters wrote: > I'm on Rose::DB - 0.734, Rose::DB::Object - 0.764. Am I behind the times or > is this a red herring? Ah, yes, you're behind the times :) You should upgrade to the latest versions: Rose::DB 0.737 and Rose::DB::Object 0.766. Relevant to your problem is t

Re: [RDBO] Manager queries with secondary table and "or"

2008-01-10 Thread John Siracusa
On 1/10/08 8:09 PM, John Siracusa wrote: > Ah, yes, you're behind the times :) You should upgrade to the latest > versions: Rose::DB 0.737 and Rose::DB::Object 0.766. Relevant to your problem > is this item from the change list for 0.765: > > * Fixed a bug that prevented relationship and for

Re: [RDBO] Too Many connections

2008-01-10 Thread John Siracusa
On 1/10/08 5:30 PM, James Masters wrote: > Looking into this, I seem to simply be doing the following in a "for" loop > more than 100 times: > > my $shipobj = MGORD::Shipment->new(shipid => $shipid)->load(with =>['items', > 'costs', 'problems', 'predictedcosts', 'toaddress', 'fromaddress']); > >