# Help to include file in Toad editor

**URL:** <https://forums.toadworld.com/t/help-to-include-file-in-toad-editor/10530>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [June 23, 2011, 11:30am UTC](https://forums.toadworld.com/t/help-to-include-file-in-toad-editor/10530 "2011-06-23T11:30:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyril](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cyril](https://forums.toadworld.com/u/Cyril)\
**Post date:** [June 23, 2011, 11:30am UTC](https://forums.toadworld.com/t/help-to-include-file-in-toad-editor/10530/1 "2011-06-23T11:30:13Z")

</div>

Hi, and thanks for your help.

I must write a huge sql cript. I plan to split this script into several files.  
I won’t open, and call every files manually (this script will be called often). Then I would like to create a general script, using toad, calling each file.

Exemple :

I open my main script manually in toad editor.  
It looks like :

– insert customers in database  
include\_and\_exec “c:\my\_insert\_statments.sql”

– insert orders  
include\_and\_exec “c:\my\_insert\_orders.sql”

… and so on.

But is there an instruction to include and exec statements store in a external file?  
Any idea?

Cyril

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [June 23, 2011, 12:05pm UTC](https://forums.toadworld.com/t/help-to-include-file-in-toad-editor/10530/2 "2011-06-23T12:05:00Z")

</div>

On Thu, 23 Jun 2011 09:30:13 PDT  
CyrilH wrote:

> Message from: Cyril
> 
> Hi, and thanks for your help.
> 
> I must write a huge sql cript. I plan to split this script into  
> several files. I won't open, and call every files manually (this  
> script will be called often). Then I would like to create a general  
> script, using toad, calling each file.
> 
> Exemple :
> 
> I open my main script manually in toad editor.  
> It looks like :
> 
> -- insert customers in database  
> include\_and\_exec "c:\my\_insert\_statments.sql"
> 
> -- insert orders  
> include\_and\_exec "c:\my\_insert\_orders.sql"
> 
> ... and so on.
> 
> But is there an instruction to include and exec statements store in a  
> external file? Any idea?
> 
> Cyril
> 
> * * *
> 
> Historical Messages
> 
> Author: CyrilH  
> Date: Thu Jun 23 09:30:13 PDT 2011  
> Hi, and thanks for your help.
> 
> I must write a huge sql cript. I plan to split this script into  
> several files. I won't open, and call every files manually (this  
> script will be called often). Then I would like to create a general  
> script, using toad, calling each file.
> 
> Exemple :
> 
> I open my main script manually in toad editor.  
> It looks like :
> 
> -- insert customers in database  
> include\_and\_exec "c:\my\_insert\_statments.sql"
> 
> -- insert orders  
> include\_and\_exec "c:\my\_insert\_orders.sql"
> 
> ... and so on.
> 
> But is there an instruction to include and exec statements store in a  
> external file? Any idea?

@full\_path\_to\_file.sql

or

@@look\_for\_file\_in\_same\_directory\_as\_this\_file\_is\_located.sql

example:

@c:\file1.sql  
@c:\file2.sql

will run file1 and then file2. Toad will look for these files in c:  
and will show an error if it can't find them.

Exxample:

@@file3.sql  
@@file4.sql

will run file3 and file4. Toad will look for these files in the  
"current dirctory" which will be the saved file (the one that contains  
the @@commands)'s directory or toad's default directory if the editor  
isn't of a saved file.

---

<div class="post-metadata">

**Author:** ![Cyril](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@Cyril](https://forums.toadworld.com/u/Cyril)\
**Post date:** [June 24, 2011, 2:29am UTC](https://forums.toadworld.com/t/help-to-include-file-in-toad-editor/10530/3 "2011-06-24T02:29:51Z")

</div>

It perfectly works.

Thank you Jospeh.
