• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1045
  • Last Modified:

Sotred Procedure (End of file)

I read the following doc:

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.apdv.plsql.doc%2Fdoc%2Ft0053609.html

and then executed my command to read in my stored procedure, and got much further

but did not quite complete the work, this is the stored procedure:

[db2inst1@sandbox1 ddl]$ cat hello.sql
CREATE procedure DropIt ()
  LANGUAGE SQL
  modifies sql data
BEGIN
   drop table deleteme cascade;
   commit;
END;

Open in new window


This is the command I used to eliminate the semicolon errors:

[db2inst1@sandbox1 ddl]$ db2 -td/ -vf hello.sql

DB21007E  End of file reached while reading the command.

Open in new window


However,  it still has a problem of hitting the EOF, even if I terminate the last line with a semi-colon

Any ideas ?

Thanks
0
Los Angeles1
Asked:
Los Angeles1
1 Solution
 
momi_sabagCommented:
your file should look like

CREATE procedure DropIt ()
  LANGUAGE SQL
  modifies sql data
BEGIN
   drop table deleteme cascade;
   commit;
END;
/


since you specified -td/ it means that "/" is the command terminator
so you must place that after the create procedure command
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now