Showing posts with label raise exception. Show all posts
Showing posts with label raise exception. Show all posts

Friday, June 24, 2016

Netezza Stored Procedure Sample

Below is the Sample code of Netezza

Create sample Table 

create table temp1 (col1 int);


create or replace procedure test_proc()
   returns character varying(any)
   language nzplsql as
begin_proc
begin
   insert into temp1 values (1);
   raise notice 'rows impacted-, %', row_count; -- To print messages to console
exception
   when others then
   raise exception 'Exception while running test_proc. Error Message is %', sqlerrm; -- To print error messages to console
end;
end_proc;



Testing


EXECUTE TEST_PROC();