Reputation: 21
I am performing an evaluation of Oracle SQL Developer (4.0.2) in an attempt to convince my Team to Switch to this tool from TOAD. We use code templates extensively in our Team, as our source columns and tables typically have Long and complex names.
I found on this Website an article which explains that the snippets in SQL Developer are stored in a file under the AppData Directory (UserSnippets.xml).
Is there an easy way to backup Oracle SQL Developer's User Snippets?
Assuming that we do not have Access to our AppData Directory, is there a way using the SQL Developer interface to 1.) write my custom Snippets in a file to a Location of my choice, and 2.) is there a way my colleagues can Import the Contents of that same file also using their SQL Developer on their Desktops?
Upvotes: 2
Views: 4244
Reputation: 3410
Yes. Take that UserSnippets.xml and host it someone where shared. Or the format of a that file is quite simple to edit directly also.
<?xml version = '1.0' encoding = 'UTF-8'?>
<snippets>
<group category="MyStuff" language="PLSQL">
<snippet name="Test" description="">
<code>
<![CDATA[test123]]>
</code>
</snippet>
</group>
</snippets>
Then just specify where sqldev should look for the file. With one of these 2 options.
1) At startup add a flag pointing to where the shared snippets.xml file is
sqldeveloper -Draptor.user.snippets=/home/klrice/snippets.xml
or
2) edit the sqldeveloper.conf file and add it directly avoiding the need to specify at startup
edit the sqldeveloper.conf file and add
AddVMOption -Draptor.user.snippets=/home/klrice/snippets.xml
FYI these have worked for a long time. My original blog post on it was back in '06. http://krisrice.io/2006-01-25-custom-snippets-in-raptor-ea-3-v-897/
Upvotes: 5