zoukankan      html  css  js  c++  java
  • pg 循环10000次进行插入

    CREATE OR REPLACE FUNCTION tuomin()
    RETURNS VOID
    AS
    $$
    DECLARE
    t_row RECORD;
    BEGIN
    FOR t_row in 1..10000 LOOP
      INSERT INTO "public"."log_task_execution"("station_id", "hall_id", "detector_id", "task_template_id", "task_id", "station_name", "hall_name", "task_name",   "task_template_name", "detector_name", "detector_code", "task_type", "task_mode", "expected_execution_time_start", "actual_execution_time_start",   "expected_execution_time_end", "actual_execution_time_end", "execution_result", "create_date", "update_date", "create_by", "update_by", "remarks") VALUES (2, 2, 4,       2, 2, '驻地1', '会场1', '任务1', '模板1', '探针3', 'b486c54c', 1, 1, '2021-09-06 16:19:57.993', '2021-09-06 16:19:57.993', '2021-09-06 16:19:57.993', '2021-09-06 16:19:57.993', 1, '2021-09-06 17:57:15.26', '2021-09-06 17:57:15.26', NULL, NULL, NULL);

    END LOOP;
    END;
    $$
    LANGUAGE plpgsql;

    SELECT tuomin() as output;

  • 相关阅读:
    vim使用基础
    linux基本命令随笔
    linux学习笔记
    中台建设随笔
    数据密集型系统响应优化
    TCP断开连接的问题
    多渠道接入系统总结
    关于实践的认识
    博客说明
    python下载图片的问题思考
  • 原文地址:https://www.cnblogs.com/pass-ion/p/15240118.html
Copyright © 2011-2022 走看看