User files
Last modified: 21 December 2022To work with files from your machine or any other place you have access to, attach the directory you need to the Project tool window.
Running SQL files
Run an SQL file
Using a Database tool window context menu action:
Right-click a data source, or a schema and select SQL Scripts | Run SQL Script….
In the file browser window that opens, navigate to the SQL file that you want to apply.
Dragging an SQL script file:
Open the Project tool window, navigate to the SQL file, and select it.
Drag the SQL file to the data source or schema in Database tool window that you want to run it against.
Run an SQL file for several data sources
In the Project tool window (Alt+1), select file or files that you want to run.
Right-click the selection and invoke Run <configuration_name> (or press Ctrl+Shift+F10). This action creates a temporary run configuration.
In the Edit Configuration window that opens, click Add
in the Target data source / schema pane and select data sources or schemes against which you want to run the selected files.
You can click Recent
to select data sources that you used recently.
GifClick Run.
note
You can run individual statements only for one data source at a time.
note
The statements can contain parameters. Before you run these statements, specify values of these parameters.
Run individual statements
Open an SQL file in AppCode.
Click the statement that you want to execute. If you want to execute more than one statement, select (highlight) the necessary statements.
Press Ctrl+Enter or select Execute from the context menu.
Select the query console where you want to execute the statement.
note
Limitation for the SQL file size is 20 MB. When you open a file that is larger than 20 MB, you see only the first 2.5 MB of the file.
tip
In the console menu, you can associate a different console with the file, or remove the association between the file and the console (Detach Console). Otherwise, you can associate a console with a file by selecting Attach Console from the context menu of the file.
Configuring a dialect for SQL files
For better coding assistance, assign an SQL dialect to an SQL file. An SQL dialect is a DBMS-specific version of SQL.
AppCode lets you specify the SQL dialect for an individual file or all SQL and DDL files that can be stored in a directory, in your project, or on your computer.
Specify a dialect for a single SQL file
Click the dialect list, which is in the upper-right corner of the window.
Select a dialect from the dialect list.
Specify a dialect for multiple SQL files
Open settings by pressing Ctrl+Alt+S and navigate to Languages & Frameworks | SQL Dialects.
Click the Add button
and select directories or files for which you want to change a dialect.
Click Open.
Click the SQL Dialect cell and select the necessary dialect.
Apply changes and click OK.
Thanks for your feedback!