All Forums General
larun1616 29 posts Joined 09/14
25 Jan 2016
.COMPILE throws error 7947 in spite of having only one Replace Procedure Statement in BTEQ

I have a 430 Lines of Stored procedure in a SQL file. When i compile it using .COMPILE FILE <Filename> command in BTEQ, i get ERROR 7947:Only create/replace procedure allowed. My file contains only one statment replace procedure stament with includes DECLARE, EXCEPETION HANDLING AND BODY sections, but still I keep getting this error. I have even removed all the comments from the file but still facing the same issue. Please help me with this error. Appreciate your response. I would not be able to share the procedure due to security reasons. Thanks.

Fred 1096 posts Joined 08/04
25 Jan 2016

Make sure you have an outer BEGIN / END around the entire SP body, including any declarations, and that there is no semicolon before the first BEGIN.
REPLACE PROCEDURE name (parameters) options

larun1616 29 posts Joined 09/14
25 Feb 2016

THanks Fred. Finally, I sorted out the issue. The SQL file that I was using was saved using notepad. While saving it was encoded as UTF. I just changed the encoding to ANSI saved it again and tried. It worked. Hope this helps.

You must sign in to leave a comment.