I have a requirement to write a Postgres function to insert rows into one table from the other tables. But the problem is that only few columns needs to be set from the rows of the other table rest I need to set by myself.
In below table i just to fetch the
youth_enrollment_id, youth_email from some other table rest column I will set as hard coded. I am trying something like below but it is not working
INSERT INTO moyadev.notification_email_details( id, youth_enrollment_id, youth_email, email_subject, email_body, status, attempt, sent_date, last_updated_by, last_updated) uuid_generate_v4(), SELECT id, email from moyadev.youth_enrollment, 'subject', 'body', 'PENDING', '', '', 'SYSTEM', '2016-12-24 17:02:18.181'
and gives below error.
ERROR: syntax error at or near "uuid_generate_v4" SQL state: 42601 Character: 205
Any help would be much appreciated. Thanks!