You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by Eric Owhadi <er...@esgyn.com> on 2017/07/28 14:58:46 UTC
is it possible to pass a sql statement to sqlci?
Hi Trafodioneers,
I know we can use sqlci -i filename
And this will trigger an OBEY filename.
But I was wondering if there is an option to directly pass the sql statement, without writing it to a file
Sqlci -??? "select count(*) from tbl"
Eric
Re: is it possible to pass a sql statement to sqlci?
Posted by "Wang, Ai-Min (Benny)" <ai...@esgyn.cn>.
hi Eric
You can you sqlci -q "" to run a sql stastement.
发自我的 iPhone
在 2017年7月28日,23:21,Eric Owhadi <er...@esgyn.com>> 写道:
Thanks Selva and Roberta,
Eric
From: Selva Govindarajan [mailto:selva.govindarajan@esgyn.com]
Sent: Friday, July 28, 2017 10:19 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: RE: is it possible to pass a sql statement to sqlci?
Alternatively, you can do this too like any other command that supports stdin and stdout redirection
echo "select * from \"_MD_\".objects;" | sqlci
Selva
From: Roberta Marton [mailto:roberta.marton@esgyn.com]
Sent: Friday, July 28, 2017 8:06 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: RE: is it possible to pass a sql statement to sqlci?
I know you can run commands like this:
sqlci << eof
env;
values (current_user);
eof
Roberta
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Friday, July 28, 2017 7:59 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: is it possible to pass a sql statement to sqlci?
Hi Trafodioneers,
I know we can use sqlci -i filename
And this will trigger an OBEY filename.
But I was wondering if there is an option to directly pass the sql statement, without writing it to a file
Sqlci -??? “select count(*) from tbl”
Eric
RE: is it possible to pass a sql statement to sqlci?
Posted by Eric Owhadi <er...@esgyn.com>.
Thanks Selva and Roberta,
Eric
From: Selva Govindarajan [mailto:selva.govindarajan@esgyn.com]
Sent: Friday, July 28, 2017 10:19 AM
To: user@trafodion.incubator.apache.org
Subject: RE: is it possible to pass a sql statement to sqlci?
Alternatively, you can do this too like any other command that supports stdin and stdout redirection
echo "select * from \"_MD_\".objects;" | sqlci
Selva
From: Roberta Marton [mailto:roberta.marton@esgyn.com]
Sent: Friday, July 28, 2017 8:06 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: RE: is it possible to pass a sql statement to sqlci?
I know you can run commands like this:
sqlci << eof
env;
values (current_user);
eof
Roberta
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Friday, July 28, 2017 7:59 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: is it possible to pass a sql statement to sqlci?
Hi Trafodioneers,
I know we can use sqlci -i filename
And this will trigger an OBEY filename.
But I was wondering if there is an option to directly pass the sql statement, without writing it to a file
Sqlci -??? "select count(*) from tbl"
Eric
RE: is it possible to pass a sql statement to sqlci?
Posted by Selva Govindarajan <se...@esgyn.com>.
Alternatively, you can do this too like any other command that supports stdin and stdout redirection
echo "select * from \"_MD_\".objects;" | sqlci
Selva
From: Roberta Marton [mailto:roberta.marton@esgyn.com]
Sent: Friday, July 28, 2017 8:06 AM
To: user@trafodion.incubator.apache.org
Subject: RE: is it possible to pass a sql statement to sqlci?
I know you can run commands like this:
sqlci << eof
env;
values (current_user);
eof
Roberta
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Friday, July 28, 2017 7:59 AM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: is it possible to pass a sql statement to sqlci?
Hi Trafodioneers,
I know we can use sqlci -i filename
And this will trigger an OBEY filename.
But I was wondering if there is an option to directly pass the sql statement, without writing it to a file
Sqlci -??? "select count(*) from tbl"
Eric
RE: is it possible to pass a sql statement to sqlci?
Posted by Roberta Marton <ro...@esgyn.com>.
I know you can run commands like this:
sqlci << eof
env;
values (current_user);
eof
Roberta
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Friday, July 28, 2017 7:59 AM
To: user@trafodion.incubator.apache.org
Subject: is it possible to pass a sql statement to sqlci?
Hi Trafodioneers,
I know we can use sqlci -i filename
And this will trigger an OBEY filename.
But I was wondering if there is an option to directly pass the sql statement, without writing it to a file
Sqlci -??? "select count(*) from tbl"
Eric