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
The following batch will create statement like this:
drop user usr_01;
commit;
create user usr_01 password '123' tags (
arg_00001='value 00001'
,arg_00002='value 00002'
,arg_00003='value 00003'
, . . .
,arg_NNNN='value NNNN'
);
-- and then extract data from sec$users and sec$attributes for newly created user 'usr_01':
select
cast(u.sec$user_name as char(10)) login,
cast(a.sec$key as char(20)) tag,
cast(a.sec$value as char(25)) val,
sec$plugin sec_plg
from sec$users u
left join sec$user_attributes a on u.sec$user_name = a.sec$user_name
where u.sec$user_name = upper('usr_01');
Batch:
@echo off
setlocal enabledelayedexpansion enableextensions
set sql=ctags-tmp.sql
del %sql% 2>nul
set tq=%1
if .%1.==.. set tq=10
echo drop user usr_01;>>%sql%
echo commit;>>%sql%
echo create user usr_01 password '123' tags (>>%sql%
for /l %%i in (1,1,%tq%) do (
set /a k=100000+%%i
set k=!k:~-5!
if .%%i.==.1. (
echo arg_!k!='value !k!'>>%sql%
) else (
echo ,arg_!k!='value !k!'>>%sql%
)
)
echo );>>%sql%
echo commit;>>%sql%
echo set width sec_plg 7;>>%sql%
echo select>>%sql%
echo cast(u.sec$user_name as char(10)) login,>>%sql%
echo cast(a.sec$key as char(20)) tag,>>%sql%
echo cast(a.sec$value as char(25)) val,>>%sql%
echo sec$plugin sec_plg>>%sql%
echo from sec$users u>>%sql%
echo left join sec$user_attributes a on u.sec$user_name = a.sec$user_name>>%sql%
echo where u.sec$user_name = upper('usr_01');>>%sql%
When I run this batch with argument %1 = 6000 it will create pretty big script 'ctags-tmp.sql' that is in attach.
This script:
-- works WITHOUT any error, i.e. user `u01` and his attributes (tags) are created OK.
But in fact NOT ALL attributes which are specified in .sql will be created, only ~40 instead of required 6000 (please look in attach result of this script).
Submitted by: @pavel-zotov
Attachments:
c4464-tmp.zip
The following batch will create statement like this:
drop user usr_01;
commit;
create user usr_01 password '123' tags (
arg_00001='value 00001'
,arg_00002='value 00002'
,arg_00003='value 00003'
, . . .
,arg_NNNN='value NNNN'
);
-- and then extract data from sec$users and sec$attributes for newly created user 'usr_01':
select
cast(u.sec$user_name as char(10)) login,
cast(a.sec$key as char(20)) tag,
cast(a.sec$value as char(25)) val,
sec$plugin sec_plg
from sec$users u
left join sec$user_attributes a on u.sec$user_name = a.sec$user_name
where u.sec$user_name = upper('usr_01');
Batch:
@echo off
setlocal enabledelayedexpansion enableextensions
set sql=ctags-tmp.sql
del %sql% 2>nul
set tq=%1
if .%1.==.. set tq=10
echo drop user usr_01;>>%sql%
echo commit;>>%sql%
echo create user usr_01 password '123' tags (>>%sql%
for /l %%i in (1,1,%tq%) do (
set /a k=100000+%%i
set k=!k:~-5!
if .%%i.==.1. (
echo arg_!k!='value !k!'>>%sql%
) else (
echo ,arg_!k!='value !k!'>>%sql%
)
)
echo );>>%sql%
echo commit;>>%sql%
echo set width sec_plg 7;>>%sql%
echo select>>%sql%
echo cast(u.sec$user_name as char(10)) login,>>%sql%
echo cast(a.sec$key as char(20)) tag,>>%sql%
echo cast(a.sec$value as char(25)) val,>>%sql%
echo sec$plugin sec_plg>>%sql%
echo from sec$users u>>%sql%
echo left join sec$user_attributes a on u.sec$user_name = a.sec$user_name>>%sql%
echo where u.sec$user_name = upper('usr_01');>>%sql%
When I run this batch with argument %1 = 6000 it will create pretty big script 'ctags-tmp.sql' that is in attach.
This script:
C:\MIX\firebird\fb30\isql.exe localhost/3333:e30 -pag 9999999 -i ctags-tmp.sql 1>log 2>err
-- works WITHOUT any error, i.e. user `u01` and his attributes (tags) are created OK.
But in fact NOT ALL attributes which are specified in .sql will be created, only ~40 instead of required 6000 (please look in attach result of this script).
Commits: d284fa3 FirebirdSQL/fbt-repository@deaf333
The text was updated successfully, but these errors were encountered: