0

Is it possible to use queries like given below? If there is any better way to do it please let me know.

INSERT INTO table1 VALUES (...) RETURNING id INTO t1_id;

UPDATE table2 SET column1 = value1, column2 = value2....WHERE id = t1_id;

UPDATE table3 SET column1 = value1, column2 = value2....WHERE id = t1_id;

Thanks

1
  • That's fine. If you want to get fancy you can use a writeable CTE, but I do not advise it unless you really need to. Commented Aug 23, 2015 at 10:18

1 Answer 1

1

Queries are perfectly fine and this is the simplest way to use them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.