thanks a lot.. it worked 
---------- Post updated 28-12-11 at 12:31 PM ---------- Previous update was 27-12-11 at 04:05 PM ----------
One more hiccup again....
here is the content of a file..
cat views.sql
DROP VIEW IF EXISTS View11;
CREATE VIEW View11
AS
SELECT User.id AS userId,
User.userCDIId AS userCDIId,
Button.id AS buttonId,
includeInCallHistory,
data AS pOCData,
Button.pointOfContactId AS pointOfContactId
FROM User, UserCDI, Button, PointOfContact
WHERE User.userCDIId = UserCDI.id
AND Button.parentUserCDIId = UserCDI.id
AND Button.pointOfContactId = PointOfContact.id
AND buttonType = 'PointOfContact';
DROP VIEW IF EXISTS View22;
CREATE VIEW View22
AS
SELECT User.id AS userId,
User.userCDIId AS userCDIId,
data AS personalPOCData,
Button.personalPointOfContactId AS personalPointOfContactId
FROM User, UserCDI, Button,PersonalPointOfContact
WHERE User.userCDIId = UserCDI.id
AND Button.parentUserCDIId = UserCDI.id
AND Button.personalPointOfContactId = PersonalPointOfContact.id
AND buttonType = 'PersonalPointOfContact';
i am trying to extract one view at a moment starting from create view to ';' which marks its end...
i was using the below few commands
firstword="CREATE VIEW View11"
sed -n "/$firstword\$/,/;/p" views.sql | awk '!x[$1]++' > procextract.sql
#the above commands extracts that prticular view and paste to procextract.sql
echo "`sed "/$firstword\$/,/;/d" views.sql `" > views.sql
#the above command deletes that particular view from the views.sql file
when i tried the command say first command which extracts a particular view its not exactly cutting it from "create view view_name" to ";" rather last one or two lines are missing..
here is the output..
cat procextract.sql
CREATE VIEW View11
AS
SELECT User.id AS userId,
User.userCDIId AS userCDIId,
Button.id AS buttonId,
includeInCallHistory,
data AS pOCData,
Button.pointOfContactId AS pointOfContactId
FROM User, UserCDI, Button, PointOfContact
WHERE User.userCDIId = UserCDI.id
AND Button.parentUserCDIId = UserCDI.id
here last two lines are missing that is
AND Button.pointOfContactId = PointOfContact.id
AND buttonType = 'PointOfContact';
are missing.. so how to rectify this bug....?
---------- Post updated at 01:44 PM ---------- Previous update was at 12:31 PM ----------
can anyone help me on this one...?