# How to run multiple (transactional) queries with new SQL Storage

**URL:** <https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160>\
**Category:** ionic-v3\
**Created:** [May 16, 2016, 11:20am UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160 "2016-05-16T11:20:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfabc](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alfabc](https://forum.ionicframework.com/u/alfabc)\
**Post date:** [May 16, 2016, 11:20am UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160/1 "2016-05-16T11:20:06Z")

</div>

I see that ionic 2 handle sql/local storage problem with its own API. It is so good.

I want to ask that SqlStorage API how to handle transactional aueries?

let storage = new Storage(SqlStorage);

storage.query(“CREATE TABLE hede…”)  
storage.query(‘insert into hede…’);  
storage.query(‘insert into hede…’);  
storage.query(‘insert into hede…’);  
…

is this runs transactional? Or how to achieve this?

---

<div class="post-metadata">

**Author:** ![xr0master](https://avatars.discourse-cdn.com/v4/letter/x/b4bc9f/32.png) [@xr0master](https://forum.ionicframework.com/u/xr0master)\
**Post date:** [May 16, 2016, 11:56am UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160/2 "2016-05-16T11:56:43Z")

</div>

What about insert multiple values by one query?

---

<div class="post-metadata">

**Author:** ![alfabc](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alfabc](https://forum.ionicframework.com/u/alfabc)\
**Post date:** [May 16, 2016, 12:22pm UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160/3 "2016-05-16T12:22:04Z")

</div>

Actually I realise that this API only support INSERT, UPDATE, DELETE fro the documentation. I guess all the way this API not enough for PRODUCTION:

- Create table,
- Drop table
- INSERT, UPDATE, DELETE queries
- and of course transaction ability required.

Instead of this i have to use [https://github.com/driftyco/ionic-native](https://github.com/driftyco/ionic-native) i guess.

---

<div class="post-metadata">

**Author:** ![omar123456789](https://avatars.discourse-cdn.com/v4/letter/o/cdc98d/32.png) [@omar123456789](https://forum.ionicframework.com/u/omar123456789)\
**Post date:** [August 9, 2016, 7:47am UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160/4 "2016-08-09T07:47:13Z")

</div>

How? Could you please give an example ?

---

<div class="post-metadata">

**Author:** ![xr0master](https://avatars.discourse-cdn.com/v4/letter/x/b4bc9f/32.png) [@xr0master](https://forum.ionicframework.com/u/xr0master)\
**Post date:** [August 9, 2016, 7:53am UTC](https://forum.ionicframework.com/t/how-to-run-multiple-transactional-queries-with-new-sql-storage/52160/5 "2016-08-09T07:53:01Z")

</div>

```auto
INSERT INTO mytable (col1, col2, col3) VALUES
    (1, 2, "abc"),
    (2, 4, "xyz"),
    (3, 5, "aaa"),
    (4, 7, "bbb");

```
