# Executing a script that executes another (using @)

**URL:** <https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [February 8, 2018, 7:34am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571 "2018-02-08T07:34:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALS82GT](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ALS82GT](https://forums.toadworld.com/u/ALS82GT)\
**Post date:** [February 8, 2018, 7:34am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/1 "2018-02-08T07:34:35Z")

</div>

Hi,

I am trying to run a script that executes a script inside it (using @) and I am getting errors when the first script tries to execute the second (p5.sql). When I run the script in regular TOAD I get no errors. Thanks for your help!

**Script 1 inserts a record into table DPOINT and then executes script p5.sql**

_insert into dpoint values (‘Run Progs–P5’);_

_commit;_

_@p5.sql_

**Script p5.sql inserts another record in DPOINT**

_insert into dpoint values (‘aaaaa’);_

_commit;_

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 8, 2018, 8:00pm UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/2 "2018-02-08T20:00:31Z")

</div>

Opening a file and reading the contents using @sqlfile is a SQL_Plus feature. The Toad Data Point editor does not support SQL_Plus. We do have another utility that does. On the Editor menu there is an action called “Execute SQL Script in external APP”. If you select this it will send the contents of your editor into an app call “Script Runner” and this app will support SQL\*Plus.

---

<div class="post-metadata">

**Author:** ![ALS82GT](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ALS82GT](https://forums.toadworld.com/u/ALS82GT)\
**Post date:** [February 14, 2018, 12:21pm UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/3 "2018-02-14T12:21:26Z")

</div>

Thanks for the information… Now all I need to know is how to set up the parameters… Can you help me with that? Thanks

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [February 14, 2018, 8:00pm UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/4 "2018-02-14T20:00:21Z")

</div>

I believe everything should be set up. Just send the whole file to the external app. Give it a try.

---

<div class="post-metadata">

**Author:** ![ALS82GT](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ALS82GT](https://forums.toadworld.com/u/ALS82GT)\
**Post date:** [February 15, 2018, 6:24am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/5 "2018-02-15T06:24:24Z")

</div>

Hi, I tried and it doesn’t work… All I want is the ability to execute the same scripts that I do in _TOAD for Oracle_ in TDP using the TDP Automation feature, but it seems I will not be able to do that.

---

<div class="post-metadata">

**Author:** ![john.mcgraw](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@john.mcgraw](https://forums.toadworld.com/u/john.mcgraw)\
**Post date:** [February 15, 2018, 7:01am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/6 "2018-02-15T07:01:41Z")

</div>

So...I have to disagree here. I have an Automation Script that was written honestly a while ago, but does contain SQL_Plus. Now I will admit that the script doesn't read in any files using @, but it is for sure SQL_Plus.

 ![1007.Capture.png](https://global.discourse-cdn.com/quest/original/2X/2/28b574e2c942e4e721e308988d121f55bd9c96d0.png)

---

<div class="post-metadata">

**Author:** ![ALS82GT](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ALS82GT](https://forums.toadworld.com/u/ALS82GT)\
**Post date:** [February 15, 2018, 7:23am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/7 "2018-02-15T07:23:33Z")

</div>

Are you able to run a very simple script such as the one below using automation?

Set define on

Define P\_NAME = ‘BILL’

select ‘&&p\_name.\_123’ from dual;

---

<div class="post-metadata">

**Author:** ![john.mcgraw](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@john.mcgraw](https://forums.toadworld.com/u/john.mcgraw)\
**Post date:** [February 15, 2018, 7:43am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/8 "2018-02-15T07:43:50Z")

</div>

No, but this did work just fine...

DECLARE

```
P_NAME varchar2(4);

```

BEGIN

```
P_NAME := 'BILL';

dbms_output.Put_LIne(P_Name);

```

END;

**John Mc Graw  
Data and Reporting Specialist**

P 303-866-6974

1575 Sherman Street, Denver CO 80203

[john.mcgraw@state.co.us](mailto:john.mcgraw@state.co.us) I [www.colorado.gov/cdhs](http://www.colorado.gov/cdhs)

On Thu, Feb 15, 2018 at 8:35 AM, ALS82GT [bounce-ALS82GT@toadworld.com](mailto:bounce-ALS82GT@toadworld.com) wrote:

> **[RE: Executing a script that executes another (using @)](http://www.toadworld.com/products/toad-data-point/f/36/p/34978/69460#69460)**

> Reply by ALS82GT  
> Are you able to run a very simple script such as the one below using automation?

> Set define on

> Define P\_NAME = 'BILL'

> select '&&p\_name.\_123' from dual;

> To reply, please reply-all to this email.
> 
> [Stop receiving emails](http://www.toadworld.com/products/toad-data-point/f/36/t/34978?subscribe=false) on this subject.
> 
> Or [Unsubscribe from Toad Data Point Forum](http://www.toadworld.com/products/toad-data-point/f/36?subscribe=false) notifications altogether.
> 
> Toad Data Point - Discussion Forum

> [Flag](http://www.toadworld.com/products/toad-data-point/f/36/p/34978/69460?AbuseContentId=143206d0-3ada-4ad5-a5df-f95fc1ab2132&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true) this post as spam/abuse.

---

<div class="post-metadata">

**Author:** ![ALS82GT](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ALS82GT](https://forums.toadworld.com/u/ALS82GT)\
**Post date:** [February 15, 2018, 9:10am UTC](https://forums.toadworld.com/t/executing-a-script-that-executes-another-using/40571/9 "2018-02-15T09:10:57Z")

</div>

Thanks for trying John, but still not what I want…

Problem is, most of our scripts were written in “TOAD for Oracle” which allows things like DEFINE, SET, &&, etc. Now I am told we need to Automate these scripts using Data Point. These scripts (such as the simple examples I gave) DO run in TOAD for Oracle but DO NOT run in Data Point.
