<< Click to Display Table of Contents >>

Navigation:  Streaming SQL Reference Guide > DROP statements >


Previous pageReturn to chapter overviewNext page

DROP STREAM removes the definition of a (local) stream previously defined by CREATE STREAM. Note that foreign streams must be dropped using DROP FOREIGN STREAM.




If any objects (such as a view or pump) depend upon the stream, the drop will fail unless the CASCADE option is specified. The default option is RESTRICT.


In the following example, pump "emailSuspectTransactions" is defined as:

CREATE PUMP "emailSuspectTransactions" AS

INSERT INTO "LOCALDB"."EDAMAME"."Alerts" ("recipient", "subject", "body")

(SELECT STREAM "EmailAlertContent"."recipient"

            , "EmailAlertContent"."subject"

            , "EmailAlertContent"."body"

FROM "LOCALDB"."EDAMAME"."EmailAlertContent" AS "EmailAlertContent")


Neither the stream edamame."Alerts" nor the (stream) view edamame."EmailAlertContent" can be dropped unless the CASCADE option is specified, because they are both referenced by the definition of this pump.

0: jdbc:sqlstream:> set schema 'edamame';

No rows affected (0.27 seconds)

0: jdbc:sqlstream:> drop stream "Alerts";

Error: Dropping foreign stream "EDAMAME"."Alerts" requires CASCADE because

                         other objects still reference it (state=,code=0)

0: jdbc:sqlstream:> drop view "EmailAlertContent";

Error: Dropping view "EDAMAME"."EmailAlertContent" requires CASCADE because

                          other objects still reference it (state=,code=0)