postgresql - SQL Query error insert into -
I am trying to do this function:
create the function "SA_PRJ" or Change .usp_verify_allocated_time (p_uid integer, p_project_id integer, numeric p_allocated_time, numeric, p_task_desc character gives different p_achieved_time, declared different character, p_date timestamp $ body $ alloc_id integer as p_obs) without time zone zero; "SA_ADM" .usp_check_permission not start (p_uid, 'SA_PRJ', 'usp_add_timesheet_record') exception raise "user ID% New permisii pentru aceasta operatie! ', P_uid; end if; Select *, case when SUM (fld_allocated_time) / 24
I want to create a function to join tables in two columns "SD_PRJ". Tbl_project
and "SD_PRJ" .tbl_project_timesheet
and compare compare SUM (fld_allocated_time) / 24 & lt; Fld_allocated_days is an input parameter
and if it is okay to insert it. p_project_id (where t.fld_project_id = p_project_id)
to
The input column can be higher than the fld_project_id in 1 table.
tbl_ = table name fld_ = column / field name "SD_PRJ" = my schema name \ ERROR: "On INTO" or his syntax error
error:
line 12: Insert "SD_PRJ" .tbl_project_timesheet (fld_emp_id, fl ... ^
******** ** ** error ********
error: syntax error "INTO" or her "INTO" SQL Condition: 42,601 characters: 550
Yes, you are Enter
try to write in a select
statement. / P>
Something like what you might want:
INSERT "SD_PRJ" .tbl_project_timesheet (fld_emp_id, fld_project_id, fld_isited_time, fld_task_desc, fld_obs) p_uid, p_project_id, coalesce (alloc_id, 0), p_allocated_time, p_achieved_time, p_task_desc, select from p_obs (SELECT p.fld_id, p .fld_allocated_days, "SD_PRJ" from t.fld_allocated_time .tbl_project p Inner JOIN "SD_PRJ"). On tbl_project_timesheet T p.fld_id = t.fld_id where t.fld_project_id = p_project_id) aka Group as of fld_id, fld_allocated_days, fld_allocated_time sum of (fld_allocated_time) / 24 of & lt; Fld_allocated_days
Not entirely sure that everything is okay, but this is a general summary of what I think.
Comments
Post a Comment