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.
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
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.