# SELECT \* translated into QBSelect / QueryBuilder

**URL:** <https://forum.servoy.com/t/select-translated-into-qbselect-querybuilder/18141>\
**Category:** Classic Servoy\
**Created:** [August 28, 2014, 12:24pm UTC](https://forum.servoy.com/t/select-translated-into-qbselect-querybuilder/18141 "2014-08-28T12:24:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deezzub](https://avatars.discourse-cdn.com/v4/letter/d/dec6dc/32.png) [@deezzub](https://forum.servoy.com/u/deezzub)\
**Post date:** [August 28, 2014, 12:24pm UTC](https://forum.servoy.com/t/select-translated-into-qbselect-querybuilder/18141/1 "2014-08-28T12:24:20Z")

</div>

How can I write SELECT \* as QBSelect (QueryBuilder)?

I found out, that I can use query.result.add( query.columns.index ) as SELECT index, but is seems not to work like this: query.result.add( query.columns[‘\*’] ).

How can I get all columns with the QueryBuilder?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 29, 2014, 4:43pm UTC](https://forum.servoy.com/t/select-translated-into-qbselect-querybuilder/18141/2 "2014-08-29T16:43:19Z")

</div>

Hi Sebastian,

It seems the QueryBuilder doesn’t support the SELECT \* syntax. You need to name every column you want to query which is a pain.  
You could file a feature request for this.

In the mean time you could use the following method to get all columns:

```auto
/**
  * @param {QBSelect} _oSelect
  */
function getAllColumns(_oSelect) {
    /** @type {Array<String>} */
    var _aNames = _oSelect.columns['allnames'];
    _aNames.map(function(_sName) {
        _oSelect.result.add(_oSelect.getColumn(_sName));
    });
    // no need to return anything since it was passed as a reference
}

```

Then you just call it like so:

```auto
getAllColumns(query);

```

Hope this helps.
