You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by siva <si...@bizruntime.com> on 2018/11/21 01:43:18 UTC

Get Field Names In Select Query

Hi,

How to get the field names in select query?

I am using sql api to create tables (Not based on model class because table
and its fields need to create dynamically and its fields more than 100).

Let Assume i want to create a person table it contains more than 100 fields
and  i am creating like bellow with out model class
/ cache.query(new SqlFieldsQuery(
                 "CREATE TABLE Persons (id LONG PRIMARY KEY, name
VARCHAR,jurney date,,,,,,,,,,,,,,) WITH
"template=replicated,CACHE_NAME=Persons)).getAll()/


Query:
-------
Get All The Person Details Based On Person Id And Journey Date

If i use SqlFields query i am not able to get the field names along with the
values.

If i use SqlQuery i need to mention model class 










--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Get Field Names In Select Query

Posted by siva <si...@bizruntime.com>.
Thank You Peter ,Its helped  :)



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Get Field Names In Select Query

Posted by Peter Sham <pe...@yahoo.com>.
 If you don't do GetAll() and just do Query(new SqlFieldsQuery...), the FieldsQueryCursor returned will have the column count and name of your result set.
Hope this help.
    On Tuesday, November 20, 2018, 8:43:22 PM EST, siva <si...@bizruntime.com> wrote:  
 
 Hi,

How to get the field names in select query?

I am using sql api to create tables (Not based on model class because table
and its fields need to create dynamically and its fields more than 100).

Let Assume i want to create a person table it contains more than 100 fields
and  i am creating like bellow with out model class
/ cache.query(new SqlFieldsQuery(
                "CREATE TABLE Persons (id LONG PRIMARY KEY, name
VARCHAR,jurney date,,,,,,,,,,,,,,) WITH
"template=replicated,CACHE_NAME=Persons)).getAll()/


Query:
-------
Get All The Person Details Based On Person Id And Journey Date

If i use SqlFields query i am not able to get the field names along with the
values.

If i use SqlQuery i need to mention model class 










--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/