You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let UPDATE, INSERT and DELETE work on data passed in parameter. #348
vardata=[{a:1,b:10},{a:2,b:20},{a:1,b:30}];varres=alasql('SELECT a, SUM(b) AS b FROM ? GROUP BY a',[data]);console.log(res);// [{"a":1,"b":40},{"a":2,"b":20}]
alasql('CREATE TABLE one');
alasql.tables.one.data = data;
var datasets=alasql('update one SET key=? WHERE inputtype=?;select * from one; truncate table one',['accesstypeaaaaa','multiselect']);
console.log(datasets[1])
/*check if table is truncated */
var red=alasql('select * from one')
console.log(red)
Activity
mathiasrw commentedon Jul 2, 2015
Can you elaborate on the problem?
agershun commentedon Jul 2, 2015
?inUPDATEis not currently supported. We can add this if it is required.agershun commentedon Jul 2, 2015
Do we need the same for
INSERTandDELETE?pasapsi commentedon Jul 2, 2015
hard to say, I'm just as solutions to their problems find various inconveniences in the library
pasapsi commentedon Jul 2, 2015
@mathiasrw
The problem is that I can not update the data in the structure :(, based on the rules of writing a request for mysql or mssql
agershun commentedon Jul 2, 2015
I will try to see can we implement
?in INSERT/DELETE/UPDATE statements.agershun commentedon Jul 2, 2015
The syntax can be:
pasapsi commentedon Jul 2, 2015
cool, change object occurs on the link?
pasapsi commentedon Jul 2, 2015
Sample
OR
agershun commentedon Jul 2, 2015
The first option. The
resfor the first case will be 1 (only one record was inserted).I will try to program this tonight.
pasapsi commentedon Jul 2, 2015
Thank you for such a library as alasql 👍
agershun commentedon Jul 2, 2015
Probably, we do not need INSERT INTO ? because it easier to use:
:) But for UPDATE and DELETE it can have sense.
pasapsi commentedon Jul 2, 2015
Perhaps, but what to do if you want to implement such a request?
agershun commentedon Jul 2, 2015
This particular query already works.
But for parameter data:
13 remaining items
mathiasrw commentedon Mar 2, 2017
SELECTis already supported:jiron12 commentedon Mar 2, 2017
No I'm talking about something more like this:
matt212 commentedon Jun 2, 2018
Hi,
i am using current version of alasql 0.4.5
i am unable to perform update on json array
js fiddle url:
alasql update jsfiddle
error:-

what is proper way to update jsonarray using alasql !
mathiasrw commentedon Jun 2, 2018
I get this when clicking on the link
matt212 commentedon Jun 6, 2018
@mathiasrw sorry , i edited my post with valid jsfiddle url please check now
FYI:
update reference link
mathiasrw commentedon Jun 6, 2018
This issue (#348) is still open because this is still a feature request
matt212 commentedon Jun 7, 2018
@mathiasrw ,
current workaround for time being
jsfiddle url:
updated workaround
rtxu commentedon Sep 23, 2019
Voted up on FeatHub
jhvissotto commentedon Mar 17, 2020
I have the same problem!
Danilo-Araujo-Silva commentedon Jan 9, 2021
Please add this ;)
syonfox commentedon Mar 31, 2021
correct me if im working but what we need is a pg format function that runs in the browser https://github.com/datalanche/node-pg-format
this is a node app but it have dependencies and just needs to be copied into a file see bellow. and then we can do this
... i realize this is not right now haha guna leave this here anyway :) might help someone +1 for update support
format.js