Advertisement
TemmieDS

Untitled

Jul 23rd, 2020
1,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.54 KB | None | 0 0
  1. SQL State  : 42703
  2. Error Code : 0
  3. Message    : ERROR: column "ELEVATOR_CAR_TRIM" does NOT exist
  4.   WHERE: PL/pgSQL FUNCTION inline_code_block line 17 AT FOR over EXECUTE statement
  5. Location   : db/migration/V2020.07.06.14.00__add_new_options_fields.SQL (C:\git\elevators\elevator-toolbox\persistence\target\classes\db\migration\V2020.07.06.14.00__add_new_options_fields.SQL)
  6. Line       : 9
  7. Statement  : DO
  8. $$
  9.     <<first_block>>
  10.         DECLARE
  11.         mirror_size_field_id  bigint;
  12.         dowels_count_field_id bigint;
  13.         spec_iter1            int;
  14.         spec_iter2            int;
  15.         rec                   RECORD;
  16.         ff_query              text;
  17.     BEGIN
  18.  
  19.         SELECT id INTO mirror_size_field_id FROM field WHERE name = 'mirror_size';
  20.         SELECT id INTO dowels_count_field_id FROM field WHERE name = 'dowels_count';
  21.  
  22.         ff_query := 'select id from filled_form where form_id = "ELEVATOR_CAR_TRIM"';
  23.  
  24.         FOR rec IN EXECUTE ff_query USING spec_iter1
  25.             LOOP
  26.                 INSERT INTO filled_field (field_id, filled_form_id, VALUE, created)
  27.                 VALUES (mirror_size_field_id, rec.id, NULL, CURRENT_TIMESTAMP);
  28.             END LOOP;
  29.  
  30.         ff_query := 'select id from filled_form where form_id = "OPTIONS"';
  31.  
  32.         FOR rec IN EXECUTE ff_query USING spec_iter2
  33.             LOOP
  34.                 INSERT INTO filled_field (field_id, filled_form_id, VALUE, created)
  35.                 VALUES (dowels_count_field_id, rec.id, NULL, CURRENT_TIMESTAMP);
  36.             END LOOP;
  37.  
  38.     END first_block
  39. $$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement