[ic] nuttyness with database select

John Allman interchange-users@icdevgroup.org
Fri Sep 6 11:19:01 2002


mike@perusion.com wrote:

>Quoting John Allman (allmanj@houseofireland.com):
>  
>
>>mike@perusion.com wrote:
>>
>>    
>>
>>>Quoting John Allman (allmanj@houseofireland.com):
>>> 
>>>
>>>      
>>>
>>>>[query arrayref=myref sql="select code,descrip,template from cattable 
>>>>where code=252"]
>>>><!--body not used... -->
>>>>[/query]
>>>>[perl]
>>>>       foreach $line (@$ary) {
>>>>               ($code,$descrip,$template) = @$line;
>>>>               $Scratch->{foundstuff}="yes";
>>>>       }
>>>>[/perl]
>>>>did i find stuff?[scratch foundstuff] says i<br>
>>>>
>>>>it just prints out "did i find stuff? says i"
>>>>   
>>>>
>>>>        
>>>>
>>>If cattable is not in the same database as "products", then you
>>>would need [query base=cattable ....]. Otherwise it should work.
>>>
>>> 
>>>
>>>      
>>>
>>it _is_ in the same database as products, but that is not the same 
>>database that everything else is in (if that's any help.) i added in the 
>>line anyway and it made no difference. i realise it should work, which 
>>is what's upsetting me. perhaps you could suggest an alternative means 
>>of doing what i want? i'm something of a newbie to interchange and still 
>>haven't found out all it's features.
>>
>>    
>>
>
>Oh, wait a minute. Where is your:
>
>	my $ary = $Tmp->{myref};
>
>??
>
>  
>
oh dear god no!:(
there is a genuine error somewhere but apparently in my stripping down 
of the code i left that very neccessary bit out. that's what you get for 
doing this stuff tired. i will try and produce the real error. making 
that correction solved my problem and my sanity is restored.

you are a god among men mike