如何参数化jdbc请求插入值?
How to parameterized jdbc request to insert values?
我在 jmeter 的 JDBC 请求中有以下查询。我需要参数化查询中的每个字段以发送 values.ID 应该一个一个递增,而其他值生成为随机值。
如果有人能对此提出意见,我们将不胜感激。
insert into product.test (id,business_center,item_group,attribute_group,created_on,modified_by)
values ('${id}','bc','ig','ag','2021-08-17 13:03:34','Test');
类似于:
insert into product.test (id,business_center,item_group,attribute_group,created_on,modified_by)
values ('${__counter(FALSE,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomDate(yyyy-MM-dd,now,2022-12-31,,)} 13:03:34',
'${__RandomString(4,abcdefghijklmnopqrstuvwxyz,)}${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}')
应该能帮到你。
更多信息:
我在 jmeter 的 JDBC 请求中有以下查询。我需要参数化查询中的每个字段以发送 values.ID 应该一个一个递增,而其他值生成为随机值。 如果有人能对此提出意见,我们将不胜感激。
insert into product.test (id,business_center,item_group,attribute_group,created_on,modified_by)
values ('${id}','bc','ig','ag','2021-08-17 13:03:34','Test');
类似于:
insert into product.test (id,business_center,item_group,attribute_group,created_on,modified_by)
values ('${__counter(FALSE,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}',
'${__RandomDate(yyyy-MM-dd,now,2022-12-31,,)} 13:03:34',
'${__RandomString(4,abcdefghijklmnopqrstuvwxyz,)}${__RandomString(2,abcdefghijklmnopqrstuvwxyz,)}')
应该能帮到你。
更多信息: