Answer the question
In order to leave comments, you need to log in
Using execute method parameters in stored procedures?
Question to those who worked with VKontakte stored procedures.
There is a stored procedure that looks for groups with audio recordings:
var q;
var groups = API.groups.search({"q": q});
if (groups.length == 0) {
return {};
}
var i = 1;
var res = [];
while (i < groups.length - 1){
i = i + 1;
var grp = groups[i];
var songs = API.audio.getCount({oid: -grp.gid});
if ( songs > 1 &&
(grp.is_closed == 0 || grp.is_member == 1))
{
res = res + [{"songs" : songs,
"gid" : grp.gid,
"name" : grp.name,
"screen_name" : grp.screen_name,
"photo": grp.photo}];
}
}
return res;
You can call the stored procedures created in the interface using the following construction:
api.vk.com/method/execute.PROCEDURE_NAME?PARAMETER_LIST... The passed
parameters will be available inside the procedure code as ordinary variables.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question