Print between multi line pattern

Hi,

I have a file with text like this

.SET WIDTH 10000 
.SET MAXERROR 1   
insert into new_db  
SELECT 
* 
FROM 
some_db  

;
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.SET WIDTH 10000
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
.SET MAXERROR 1
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-

insert into new_db

SELECT
*
FROM
some_db

;

I have tried

sed -n '/\.SET MAX.*$/,/;/p' file

But I am getting output as

.SET MAXERROR 1   
insert into new_db  
SELECT 
* 
FROM 
some_db  

;
.SET MAXERROR 1
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-

insert into new_db

SELECT
*
FROM
some_db

;

But I need output as below from the second instance i.ee it has to match the pattern
.SET MAXERROR 1
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-

insert into new_db
 
 SELECT
 *
 FROM
 some_db

;

Thanks in advance

awk '/insert/,/;/' file

I can use that, but it is not always same, it can have select, delete, create, drop or any thing .

Try:

perl -ln0e '/\+-\n\n(.*?;)/s;print $1' file