业务场景: 需要传递给比较长的字符串, 写入到系统参数中, 在服务器中再取出内容. 测试脚本有几个问题: 1. 建议增加 inp_set_max_len, 可以调整到2000或4000, ntext不限制长度, 可能会需要传递多点数据 2. pub_para_set_save, 当保存的参数值过长时, 会导致客户端直接崩溃 3. pub_para_get, 这个函数会自动截断了取出的参数值, 在数据库中很长, 但是取出来就只有一部分 脚本如下: int test() { return 1; }; int main() { dbg_clear(); inp_clear(); inp_def_memo('batch_no', '批次'); inp_set_max_len('batch_no', 1000); inp_para_set_title('批次明细'); if (inp_para() == 1) { string batch_no; batch_no = inp_get_val('batch_no'); dbg('batch_no: ' + batch_no); // 修改参数 // pub_para_set_save('ks_batch_no', batch_no); // ------ batch_no 过长, 会导致客户端崩溃 string sql; sql = "delete from app_para where para_id='ks_batch_no'"; db_run(sql); sql = "insert into app_para (para_id, para_value) values ('ks_batch_no', '" + batch_no + "')"; db_run(sql); msg('finish'); } dbg_clear(); string batch_no; batch_no = pub_para_get('ks_batch_no'); // ------ 这个也会截断参数值, dbg(batch_no); return 1; }; 传递内容, 测试数据, 更长就不行了. 因为参数最大长度目前只支持1000, : 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 20240802202408021020373440100E64212 20240805202408051020373440100E64612 20240806202408061020373440100E64612 20240823202408231020373440100E63812 |