You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by zhaochuge <zh...@outlook.com> on 2015/03/27 09:26:19 UTC

phoenix psql.py tool call sql script and send the parameter

Hi guys,

         I want send the parameter to the sql script when using phoenix
psql.py tool call sql script . I don't know this method is feasible . 

         If the method is feasible , please provid psql.py tool syntax and
phoenix sql script using variable syntax .

Thanks.

 

O'neal


Re: phoenix psql.py tool call sql script and send the parameter

Posted by Mark Tse <Ma...@D2L.com>.
Instead of passing in a file reader, it looks like we can pass in a StringReader to PhoenixConnection.executeStatements?().

If we change PhoenixRuntime a bit to take in a query string (maybe with a '-q' parameter or something), it'll be easy to write a new python script where the first argument is the .sql file, and the rest are the positional arguments.

Mark


________________________________
From: Gabriel Reid <ga...@gmail.com>
Sent: Saturday, March 28, 2015 8:20 AM
To: user@phoenix.apache.org
Subject: Re: phoenix psql.py tool call sql script and send the parameter

Hi,

No, there isn't currently any way to do any kind of variable/parameter replacement via psql.py. I think there must be some clever ways to do this automatically on the command line outside of psql, although I'm not aware of any specific way of doing it.

- Gabriel


On Fri, Mar 27, 2015 at 9:27 AM zhaochuge <zh...@outlook.com>> wrote:
Hi guys,
         I want send the parameter to the sql script when using phoenix psql.py tool call sql script . I don't know this method is feasible .
         If the method is feasible , please provid psql.py tool syntax and phoenix sql script using variable syntax .
Thanks.

O'neal

Re: phoenix psql.py tool call sql script and send the parameter

Posted by Gabriel Reid <ga...@gmail.com>.
Hi,

No, there isn't currently any way to do any kind of variable/parameter
replacement via psql.py. I think there must be some clever ways to do this
automatically on the command line outside of psql, although I'm not aware
of any specific way of doing it.

- Gabriel


On Fri, Mar 27, 2015 at 9:27 AM zhaochuge <zh...@outlook.com> wrote:

> Hi guys,
>
>          I want send the parameter to the sql script when using phoenix
> psql.py tool call sql script . I don’t know this method is feasible .
>
>          If the method is feasible , please provid psql.py tool syntax and
> phoenix sql script using variable syntax .
>
> Thanks.
>
>
>
> O’neal
>