You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by conejo <lo...@gmail.com> on 2016/09/05 10:51:55 UTC

jdbc commands manual

Hi. Good Morning
Is there a manual for jdbc commands?
We do not know the sentences to be executed for obtain certain data.
For example:
jdbc:query myDs select count (*) from messages where id < 100

The cursor is left with the value '>' and you have to press CTRL + C to
continue.

Or 

jdbc:query myDS select count(*) from messages where asto like '%H%'
Error executing command: bad expression: select count(*) from messages where
asto like '%H%'



--
View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: jdbc commands manual

Posted by conejo <lo...@gmail.com>.
karaf@root>version
4.0.5
karaf@root>jdbc:query sacomarDS "select count \(*\) from Mensajes"
Error executing command jdbc:query: too many arguments specified
karaf@root>jdbc:query sacomarDS "select count\(*\) from Mensajes"
Error executing command jdbc:query: too many arguments specified
karaf@root>jdbc:query sacomarDS "select count(\*) from Mensajes"
Error executing command jdbc:query: too many arguments specified
karaf@root>



--
View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859p4047865.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: jdbc commands manual

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Which Karaf version ? Did you try to escape \( and \) ?

Regards
JB

On 09/05/2016 01:37 PM, conejo wrote:
> The output:
>
> karaf@root>jdbc:query sacomarDS select count(*) from Mensajes
> COUNT(*)
> --------
> 6476
> karaf@root>jdbc:query sacomarDS "select count(*) from Mensajes"
> Error executing command jdbc:query: too many arguments specified
> karaf@root>jdbc:query sacomarDS "select count (*) from Mensajes"
> Command not found: *
> karaf@root>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859p4047863.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: jdbc commands manual

Posted by conejo <lo...@gmail.com>.
The output:

karaf@root>jdbc:query sacomarDS select count(*) from Mensajes
COUNT(*)
--------
6476
karaf@root>jdbc:query sacomarDS "select count(*) from Mensajes"
Error executing command jdbc:query: too many arguments specified
karaf@root>jdbc:query sacomarDS "select count (*) from Mensajes"
Command not found: *
karaf@root>



--
View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859p4047863.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: jdbc commands manual

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Can you paste the command with the quotes ?

jdbc:query takes two arguments: the first one is the datasource name, 
the second one is the SQL query.

Regards
JB

On 09/05/2016 12:58 PM, conejo wrote:
> Thanx. But now i get:
> Error executing command jdbc:query: too many arguments specified
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859p4047861.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: jdbc commands manual

Posted by conejo <lo...@gmail.com>.
Thanx. But now i get:
Error executing command jdbc:query: too many arguments specified



--
View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859p4047861.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: jdbc commands manual

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

http://karaf.apache.org/manual/latest/#_datasources_jdbc

You need to add quote between your query:

jdbc:query myDs "select count (*) from messages where id < 100"

Regards
JB

On 09/05/2016 12:51 PM, conejo wrote:
> Hi. Good Morning
> Is there a manual for jdbc commands?
> We do not know the sentences to be executed for obtain certain data.
> For example:
> jdbc:query myDs select count (*) from messages where id < 100
>
> The cursor is left with the value '>' and you have to press CTRL + C to
> continue.
>
> Or
>
> jdbc:query myDS select count(*) from messages where asto like '%H%'
> Error executing command: bad expression: select count(*) from messages where
> asto like '%H%'
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/jdbc-commands-manual-tp4047859.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com