# Automation Variable "Invalid Number"

**URL:** <https://forums.toadworld.com/t/automation-variable-invalid-number/46659>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [May 30, 2019, 1:38am UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659 "2019-05-30T01:38:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CPK\_Premier](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/cpk_premier/32/10262_2.png) [@CPK\_Premier](https://forums.toadworld.com/u/CPK_Premier)\
**Post date:** [May 30, 2019, 1:38am UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/1 "2019-05-30T01:38:34Z")

</div>

Automation file where I want to prompt user for an Entity code whose value can be either Alphanumeric or Numeric.

In straight SQL when prompting for the value with a variable either type returns fine.

However, in automation the Alphanumeric works but the codes that are fully numeric fail as " **Invalid Number**". I've tried a number of functions in the SET VARIABLE activity, many of which work for the Alphanumeric but still fail for the fully numeric values. Variable type = String in the Set Variable set up.

TDP v5.04  
ORACLE

Thanks for any help

---

<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:** [May 30, 2019, 2:16am UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/2 "2019-05-30T02:16:14Z")

</div>

Can you provide the portion of the where clause that includes the bind? If the value can be alphanumeric or numeric then the datatype of the bind column must be varchar. What is the data type of the binding column?  
IE:  
where col\_a = :var what is datatype of col\_a. And how have you defined the bind var?

The error you are getting sounds like the binding column is a numeric and you are binding a string value.

---

<div class="post-metadata">

**Author:** ![CPK\_Premier](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/cpk_premier/32/10262_2.png) [@CPK\_Premier](https://forums.toadworld.com/u/CPK_Premier)\
**Post date:** [May 30, 2019, 12:56pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/3 "2019-05-30T12:56:31Z")

</div>

Thanks.

Where clause from the SQL script -

" **and e.CODE = :ENTITY\_CODE**"

The data type of "CODE" is VARCHAR2.

I set up the variable type as STRING. Image attached.

again, I enter a value like "MN5005" it works. but "644992" gets "invalid number".

I couldn't figure out a function in the Variable Value to make it work.

 ![TAS](https://global.discourse-cdn.com/quest/original/2X/6/6d935c38bc0b31c12bbc61254a7b047da6583160.jpeg)

---

<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:** [May 30, 2019, 8:11pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/4 "2019-05-30T20:11:42Z")

</div>

I can't seem to reproduce that issue. What version of TDP are you using? In both TDP 4.3 and 5.0x I use zip code as a column to bind. It is a varchar and I can enter numbers or zips with chars without error and with correct results.

I see you are using the Prompt for Var. When the dialog pops up what is the datatype? Mine shows string which yours should also. What is the exact error you are getting? Is it an "ORA -01722 invalid number" error? Can you post your automation log? Of if you are more comfortable with opening a support ticket we can do that also.

---

<div class="post-metadata">

**Author:** ![CPK\_Premier](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/cpk_premier/32/10262_2.png) [@CPK\_Premier](https://forums.toadworld.com/u/CPK_Premier)\
**Post date:** [May 31, 2019, 1:26am UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/5 "2019-05-31T01:26:55Z")

</div>

Toad Data Point 5.0.4.45 (32 bit)

I get STRING as the datatype in the popup. attaching logs for both a GOOD successful run with an alphanumeric value and the BAD unsuccessful run with Numeric value. Attached image is where i ran it a couple times with numeric.[NPC\_NII\_PRECHECK\_BETA\_BAD.log](https://global.discourse-cdn.com/quest/original/2X/4/4be2d726b4e3a2f3536ac9d8cf334a90e332ac88.log) (3.9 KB)  
[NPC\_NII\_PRECHECK\_BETA\_GOOD.log](https://global.discourse-cdn.com/quest/original/2X/c/c01c444cd13dc83df17ce6de2b4f881da7ed8e9e.log) (4.1 KB)

 ![TAS2](https://global.discourse-cdn.com/quest/original/2X/d/dee6b14fce201d7ac399041e50ee8b1ff2cd09ed.jpeg)

---

<div class="post-metadata">

**Author:** ![rvaldez3](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@rvaldez3](https://forums.toadworld.com/u/rvaldez3)\
**Post date:** [September 11, 2019, 4:40pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/6 "2019-09-11T16:40:07Z")

</div>

I am curious if there was ever a resolution to this issue? I am experiencing the same thing when trying to add variables to my automation. The automation I have consolidates a series of Toad Views, when I add the bind variables to the Toad Views bind screen they work fine. When I enter the variables in the automation script with the same datatypes I receive the ORA-01722 Invalid Number error. Just like the example provided in this article I am trying to create a string variable that is comprised of only numbers, no alpha characters.

I have tried both adding ' around the numbers and changing to a bind reference of #var# and neither has helped to correct the issue. I can still run the report I am trying to run, but I am unable to leverage the automation functionality due to this issue with an all numeric string not being processed properly. I have verified the datatype in the tables I am referencing, in all cases it is Varchar.

Any update would be appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![rvaldez3](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@rvaldez3](https://forums.toadworld.com/u/rvaldez3)\
**Post date:** [September 17, 2019, 6:14pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/7 "2019-09-17T18:14:20Z")

</div>

Support ticket submitted on this issue.

---

<div class="post-metadata">

**Author:** ![Filip.Cevela](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/filip.cevela/32/200_2.png) [@Filip.Cevela](https://forums.toadworld.com/u/Filip.Cevela)\
**Post date:** [September 19, 2019, 12:59pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/8 "2019-09-19T12:59:28Z")

</div>

Hi, variable in automation is not equivalent of variable in SQL. We always convert value to specific datatype so you should be able to use/set this value also on other places then on Query.

I suggest to use convert function in your query so you are sure you will use correct datatype.

Sample:  
**Select \* from table where my\_varchar\_column = TO\_CHAR(:BIND\_VAR)**

Hope it will help you  
Filip

---

<div class="post-metadata">

**Author:** ![rvaldez3](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@rvaldez3](https://forums.toadworld.com/u/rvaldez3)\
**Post date:** [September 19, 2019, 2:36pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/9 "2019-09-19T14:36:26Z")

</div>

I will give that a try in my query and add that to my notes about the variables not being the same. Based on the online documentation for Toad Data Point there did not seem to be a difference noted. It would be of great if the online documentation for Automation called out this difference so other users do not have the same issue.

---

<div class="post-metadata">

**Author:** ![rvaldez3](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@rvaldez3](https://forums.toadworld.com/u/rvaldez3)\
**Post date:** [September 19, 2019, 4:21pm UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/10 "2019-09-19T16:21:01Z")

</div>

I have tested this workaround it is working as expected in Automation. If there is a way to get Automation to recognize the Datatype and not require the TO\_CHAR it would be appreciated, but this does get us functioning.

---

<div class="post-metadata">

**Author:** ![dan](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/dan/32/12882_2.png) [@dan](https://forums.toadworld.com/u/dan)\
**Post date:** [September 20, 2019, 8:50am UTC](https://forums.toadworld.com/t/automation-variable-invalid-number/46659/11 "2019-09-20T08:50:08Z")

</div>

Hi, you're right, I'll add it to our Help.
