Skip to content

Commit 2aa467d

Browse files
authored
add if exists to drop function (#2101)
* add if exists to drop function * add if exists to drop function
1 parent 2cb267c commit 2aa467d

File tree

3 files changed

+6
-69
lines changed

3 files changed

+6
-69
lines changed

docs/sql/commands/sql-drop-function.md

+2-23
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,14 @@ Use the `DROP FUNCTION` command to remove an existing [user-defined function (UD
1313
## Syntax
1414

1515
```sql
16-
DROP FUNCTION function_name [ ( argument_type [, ...] ) ] ;
16+
DROP FUNCTION [ IF EXISTS ] function_name [ ( argument_type [, ...] ) ] ;
1717
```
1818

19-
import rr from '@theme/RailroadDiagram'
20-
21-
export const svg = rr.Diagram(
22-
rr.Sequence(
23-
rr.Terminal('DROP FUNCTION'),
24-
rr.NonTerminal('function_name'),
25-
rr.Optional(
26-
rr.Sequence(
27-
rr.Terminal('('),
28-
rr.OneOrMore(
29-
rr.NonTerminal('argument_type', 'skip'),
30-
','
31-
),
32-
rr.Terminal(')'),
33-
),
34-
),
35-
rr.Terminal(';'),
36-
)
37-
);
38-
39-
<drawer SVG={svg} />
40-
4119
| Parameter or clause | Description |
4220
|-------------------------------|-------------------------------------------------------|
4321
| *function_name* | Name of the UDF you want to drop. |
4422
| ( *argument_type* [ , ... ] ) | Optional: Argument types of the function.<br/>Specify the argument types when the name of the function you want to drop isn't unique within the schema. |
23+
|IF EXISTS| Do not return an error if the specified function does not exist. A notice is issued in this case. |
4524

4625
## Usage
4726

versioned_docs/version-1.7/sql/commands/sql-drop-function.md

+2-23
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,14 @@ Use the `DROP FUNCTION` command to remove an existing [user-defined function (UD
1313
## Syntax
1414

1515
```sql
16-
DROP FUNCTION function_name [ ( argument_type [, ...] ) ] ;
16+
DROP FUNCTION [ IF EXISTS ] function_name [ ( argument_type [, ...] ) ] ;
1717
```
1818

19-
import rr from '@theme/RailroadDiagram'
20-
21-
export const svg = rr.Diagram(
22-
rr.Sequence(
23-
rr.Terminal('DROP FUNCTION'),
24-
rr.NonTerminal('function_name'),
25-
rr.Optional(
26-
rr.Sequence(
27-
rr.Terminal('('),
28-
rr.OneOrMore(
29-
rr.NonTerminal('argument_type', 'skip'),
30-
','
31-
),
32-
rr.Terminal(')'),
33-
),
34-
),
35-
rr.Terminal(';'),
36-
)
37-
);
38-
39-
<drawer SVG={svg} />
40-
4119
| Parameter or clause | Description |
4220
|-------------------------------|-------------------------------------------------------|
4321
| *function_name* | Name of the UDF you want to drop. |
4422
| ( *argument_type* [ , ... ] ) | Optional: Argument types of the function.<br/>Specify the argument types when the name of the function you want to drop isn't unique within the schema. |
23+
|IF EXISTS| Do not return an error if the specified function does not exist. A notice is issued in this case. |
4524

4625
## Usage
4726

versioned_docs/version-1.8/sql/commands/sql-drop-function.md

+2-23
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,14 @@ Use the `DROP FUNCTION` command to remove an existing [user-defined function (UD
1313
## Syntax
1414

1515
```sql
16-
DROP FUNCTION function_name [ ( argument_type [, ...] ) ] ;
16+
DROP FUNCTION [ IF EXISTS ] function_name [ ( argument_type [, ...] ) ] ;
1717
```
1818

19-
import rr from '@theme/RailroadDiagram'
20-
21-
export const svg = rr.Diagram(
22-
rr.Sequence(
23-
rr.Terminal('DROP FUNCTION'),
24-
rr.NonTerminal('function_name'),
25-
rr.Optional(
26-
rr.Sequence(
27-
rr.Terminal('('),
28-
rr.OneOrMore(
29-
rr.NonTerminal('argument_type', 'skip'),
30-
','
31-
),
32-
rr.Terminal(')'),
33-
),
34-
),
35-
rr.Terminal(';'),
36-
)
37-
);
38-
39-
<drawer SVG={svg} />
40-
4119
| Parameter or clause | Description |
4220
|-------------------------------|-------------------------------------------------------|
4321
| *function_name* | Name of the UDF you want to drop. |
4422
| ( *argument_type* [ , ... ] ) | Optional: Argument types of the function.<br/>Specify the argument types when the name of the function you want to drop isn't unique within the schema. |
23+
|IF EXISTS| Do not return an error if the specified function does not exist. A notice is issued in this case. |
4524

4625
## Usage
4726

0 commit comments

Comments
 (0)