Invalid Input syntax for type bigint
Invalid Input syntax for type bigint
От:
Ryan Miranda <ryan.miranda@gmail.com>
Дата:
hello everyone,
I am trying to run the proc below but get an error : invalid input
syntax for type bigint: "2004-10-26" Can anyone suggest what I am
doing wrong here?
Rx
-- Function: public.getdateallocated(date, date)
DROP FUNCTION public.getdateallocated(date, date);
CREATE OR REPLACE FUNCTION public.getdateallocated(date, date) RETURNS text AS
'Declare
workflow_t ix_workflow_task%ROWTYPE;
BEGIN
SELECT ix_workflow_task."DATE_COMPLETED",
ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID", ix_workflow_task."TYPE"INTO workflow_t from ix_workflow_taskINNER JOIN ix_workflow_instance ON
ix_workflow_task."WORKFLOW_INSTANCE_KEY" =
ix_workflow_instance."WORKFLOW_INSTANCE_KEY"INNER JOIN ix_workflow_instance_to_domain ON
ix_workflow_instance_to_domain."WORKFLOW_INSTANCE_KEY" =
ix_workflow_instance."WORKFLOW_INSTANCE_KEY"INNER JOIN ix_core_case ON
ix_workflow_instance_to_domain."DOMAIN_KEY" =
ix_core_case."CORECASEKEY"where to_char(ix_workflow_task."DATE_COMPLETED", \'DD-MM-YYYY\') <> \'\'AND ix_core_case."DELETED" = 0AND ("CORECASEKEY" in (select * FROM getStatusSwitch($1,$2,
\'Assessment\', \'Prosecution\')) OR "CORECASEKEY" in (select * from
getStatusSwitch($1,$2, \'Assessment\', \'Investigation\')) OR "CORECASEKEY" in (select * from
getStatusSwitch($1,$2, \'Assessment\', \'Other\'))) group by ix_workflow_task."DATE_COMPLETED",
ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID", ix_workflow_task."TYPE"having (lower(ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID") LIKE
\'organise surveillance - 9b\' AND ix_workflow_task."TYPE" = \'Human\' or lower(ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID")
LIKE \'start case mix workflow - 9\' AND ix_workflow_task."TYPE" =
\'System\' or lower(ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID") LIKE
\'finalise case - 13\' AND ix_workflow_task."TYPE" = \'Human\' or lower(ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID") LIKE
\'complete final priority smart form - 39\' AND
ix_workflow_task."TYPE" = \'Human\' or lower(ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID") LIKE
\'check for case mix type - 17\' AND ix_workflow_task."TYPE" =
\'System\') and (ix_workflow_task."DATE_COMPLETED" >= $1 and
ix_workflow_task."DATE_COMPLETED" <= $2);
return workflow_t."WORKFLOW_ACTIVITY_XPDL_ID" ||
to_char(workflow_t."DATE_COMPLETED", \'DD-MM-YYYY\');
END;
' LANGUAGE 'plpgsql' VOLATILE;
select getdateallocated('10/10/04','12/12/04');
Re: Invalid Input syntax for type bigint
От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Sun, Jan 23, 2005 at 02:59:36PM -0800, Ryan Miranda wrote: > I am trying to run the proc below but get an error : invalid input > syntax for type bigint: "2004-10-26" Can anyone suggest what I am > doing wrong here? Apparently you're trying to use a date where a bigint is expected. One possibility might be here: > SELECT ix_workflow_task."DATE_COMPLETED", > ix_workflow_task."WORKFLOW_ACTIVITY_XPDL_ID", ix_workflow_task."TYPE" > INTO workflow_t from ix_workflow_task You declared workflow_t to be ix_workflow_task%ROWTYPE but you're only selecting certain fields into it. Is the first field in ix_workflow_task perchance a bigint? -- Michael Fuhr http://www.fuhr.org/~mfuhr/