List:General Discussion« Previous MessageNext Message »
From:Larry Martell Date:April 8 2014 8:45pm
Subject:Re: Calling function, that operates on another database
View as plain text  
On Tue, Apr 8, 2014 at 4:15 PM, bars0.bars0.bars0
<bars0.bars0.bars0@stripped> wrote:
> Hi all.
>
> I have standard select statement and on one column I want to run function,
> that will connect to another database (same server).
> Is this possible?
>
> High level example:
>
> SELECT db1.clients.client_id, getTurnover(db1.clients.client_id) FROM
> db1.clients;
>
> AND getTurnover($id) body would be something like:
>
> SELECT SUM(db2.turnover.amount) FROM db2.turnover WHERE
> db2.turnover.client_id = $id;
>
>
> So for some data, I need to make lookup to another database table.
> Is this even possible?

Yes, using just the syntax you have: db.table
Thread
Calling function, that operates on another databasebars0.bars0.bars08 Apr 2014
  • RE: Calling function, that operates on another databaseDavid Lerer8 Apr 2014
  • Re: Calling function, that operates on another databaseLarry Martell8 Apr 2014