Skip to content

How to excute with for and declare an variable? #4

@huuluan97

Description

@huuluan97

Dear usausa,
I'm have an excute sql same here below. But when i run excute, the Smart-Net-Data-Accessor always display _42703: column "p0" does not exist . Please help me how to excute sql.

DO $$
DECLARE v_list text;
BEGIN
	v_list := TRIM (/*@list*/'')::text;

	FOR item IN SELECT unnest(STRING_TO_ARRAY(v_list , ','))ele
        LOOP
            INSERT INTO user(user_id, group_id, created_by) 
						 VALUES(
				/*@userId*/'',item ,/*@createdBy*/'');
				END LOOP; 
END;
$$;

Thank you so much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions