Creating your own code snippets
Visual Studio Code has built-in snippets and Db2 Dev Extension has its own snippets. If you want to create your own set of code snippets, read Create your own snippets in the Visual Studio Code documentation.
Here’s an example of how to create your own CREATE TABLESPACE
snippet for files associated with the SQL language.
- Open the Command Palette and select Preferences: Configure User Snippets.
- Select sql (SQL) from the list.
-
In the snippet file, paste the following content and save it.
{ "CREATE TABLESPACE statement": { "prefix": "CREATE TABLESPACE statement", "body": [ "CREATE TABLESPACE ${1:tablespace-name}", "\tIN ${2:database-name}", "\tUSING STOGROUP ${3:stogroup-name};", ], "description": "Sample CREATE TABLESPACE statement" } }
-
Now start typing
CREATE TABLESPACE
in any SQL file to use the snippet.