SQL Insert loop


I want to make an sql script that would give a certain accound all rbac permissions.

Basically, it needs to repeat the following statement: 

INSERT INTO `rbac_account_permissions` (`accountId`, `permissionId`, `granted`, `realmId`) VALUES ('1', $permission, '1', '-1')

With $permission increasing every time from 1 up to 841.

I've searched the internet for quite some time, but none of the suggested methods (e.g. creating a procedure) work.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now