You can use the Delete SQL Package (DLTSQLPKG) command
to delete one or more SQL packages. You must enter the DLTSQLPKG command on the AS/400 system where the SQL package being deleted is located.
Job: B,I Pgm: B,I REXX: B,I Exec
>>-DLTSQLPKG---------------------------------------------------->
.-*LIBL/--------.
>----SQLPKG(--+---------------+---+-SQL-package-name----------+---)->
+-*CURLIB/------+ '-generic*-SQL-package name-'
+-*USRLIBL/-----+
+-*ALL/---------+
+-*ALLUSR/------+
'-library-name/-'
>--------------------------------------------------------------><
|
The possible library values are:
SQL-package-name: Specifies the name of the SQL package being deleted.
generic*-SQL-package-name: Specifies the generic name of the SQL package to be deleted. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. If a generic name is specified, all SQL packages with names that begin with the generic name, and for which the user has authority, are deleted. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete SQL package name.
You must have *OBJEXIST authority for the SQL package and at least *EXECUTE authority for the collection where it is located.
There are also several SQL methods to drop packages:
The following command deletes the SQL package PARTS1 in the SPIFFY collection:
DLTSQLPKG SQLPKG(SPIFFY/PARTS1)
To delete an SQL package on a remote AS/400 system, use the Submit Remote Command (SBMRMTCMD) command to run the DLTSQLPKG command on the remote system. See Submit Remote Command (SBMRMTCMD) command for how to use the SBMRMTCMD command. You can also use display station pass-through to sign on the remote system to delete the SQL package. If the remote system is not an AS/400 system, pass through to that system using a remote work station program and then submit the delete SQL package command local to that system.