Hi....
Iam trying to insert records into a table......when an integrity
constarint violation occurs the exception is caught........but i dont
want the whole thing to be rolled back or stopped because of one
exception. The insert statement is as follows:

'INSERT INTO '||imputation_table||'
                 (SELECT 
lane_id,speed,volume,occupancy,quality,measurement_start,measurement_end,effective_date,expiration_date
FROM '||partitionname||'
                 WHERE lane_id IN(select lane_id from lane_info where inactive 
is
null )AND (volume=255 OR speed=255 OR occupancy=255 OR occupancy>=100
OR volume>52 OR volume<0 OR speed>120 OR speed<0)
                 AND date_part(''hour'', measurement_start) between 5 and 23
                 AND date_part(''day'',measurement_start)='||theDate||')';

EXCEPTION  WHEN integrity_constraint_violation THEN
        RAISE NOTICE 'Imputation for lane at time  has been already imputed';

Is there a way i can just skip the record that causes the violation
and insert the rest of the records into the table???



Thanks
Sam

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to