Abdul Jabbar
Abdul Jabbar

Reputation: 358

alasql- Record Update Issue

I'm Trying to update record on a specific condition.

alasql("UPDATE MyDatabase.FooTBL SET Column2 = 1 Where Column1 = 'foo'")

It Throws error on console

Uncaught TypeError: Cannot read property 'tables' of undefined(…)

Can anyone suggest the solution how i will update the record.

Upvotes: 0

Views: 912

Answers (1)

mathiasrw
mathiasrw

Reputation: 618

MyAtlas does not exist - please use:

alasql('CREATE TABLE IF NOT EXISTS City (city string, population number)'); 
> 1

alasql("INSERT INTO City Values ('Vienna',894456122)");
> 1

alasql("UPDATE City SET city = 'ISLO' Where population = 894456122")
> 1

alasql('select * from City')
> [{"city":"ISLO","population":894456122}]

Upvotes: 1

Related Questions