Toad World® Forums

Data Point 3.2 Unable to evaluate variable


#1

Im at a loss.

Using data point 3.2 and all conditions return false in the automation no matter what it is.

Forgot to mention, this is just a test report, running select sysdate from dual;

which returns one row.

wtf.jpeg

I have even tried 1=1 and same thing.


#2

Try to use #RowCount_1#>0 or #RowCount_1#= 0 instead.

Igor.


#3

Did that.

In 3.2 it doesnt like the pounds, calls it an invalid variable

wtf2.jpeg


#4

Do you have errcount variable defined? Please select Variables in the left pane and double click the proper variable in the list in the right pane.

Also, having your actual script may help. Can you publish it?

Thans,

Igor.


#5

certainly, The script im running is just select sysdate from dual;

Attached is the TAS

I am defining the variable at the top of the script.

I tried an all lower case variable because i read an obscure post about a possible bug with camel case variables, but it didnt help.


<ta0:VariableActivity Variable_Name="" x:Name=“Set_Variable_1” Sql="" Variable_Value="" Description=“Create/Set Variable” ConnectDesc="{x:Null}">
ta0:VariableActivity.SetVariables
<x:Array Type="{x:Type ta0:VariableDescription}">
<ta0:VariableDescription Variable_Name=“errcount” Sql="" Variable_Type=“String” ConnectDesc="{x:Null}" Variable_Value=“10” />
</x:Array>
</ta0:VariableActivity.SetVariables>
</ta0:VariableActivity>



<ta1:SelectToExcelActivity x:Name=“File_1” LinkFile=“False” RowCountVar=“errcount” SqlScript=“select sysdate from dual;” SqlScriptEmbed="" Description=“Execute SQL and save results to file” Suffix="" ExcelFileName=“D:\ToadReports\QMS\CSTA_Errors\CSTA_Errors.html”>
ta1:SelectToExcelActivity.ExportInstanceOptions
<ns1:ExcelExportInstanceOptions FileOverwrite=“True” FileDirctory=“D:\ToadReports\QMS\CSTA_Errors” FileName=“CSTA_Errors” ExcelFile=“False” xmlns:ns1=“clr-namespace:Quest.Toad.ImportExport;Assembly=ToadCore, Version=6.3.0.916, Culture=neutral, PublicKeyToken=c862883b2ae69822”>
ns1:ExcelExportInstanceOptions.FormatSettings
<ns1:FormatSettings FormatType=“HtmlTable” Row=“1” QuoteChar="’" Column=“1” Delimiter="," FileFilter=“Excel Files (.xls)|.xls” BlockInsertValue=“500.0” FileExtension=“html” FolderImportDirectory="{x:Null}" ExcelAtLocation="{x:Null}" HeaderBackColor=“LightGray” ExcelBeforeExportMacros="{x:Null}" ExcelAfterExportMacros="{x:Null}" />
</ns1:ExcelExportInstanceOptions.FormatSettings>
</ns1:ExcelExportInstanceOptions>
</ta1:SelectToExcelActivity.ExportInstanceOptions>
ta1:SelectToExcelActivity.ConnectionDescription
<ta1:ConnectionDescription Trl="" Description="" IsNullPassword=“False” NodePath="" />
</ta1:SelectToExcelActivity.ConnectionDescription>
</ta1:SelectToExcelActivity>
<ta0:VariableIfElseActivity x:Name=“If_1”>
<ta0:VariableIfElseBranchActivity x:Name=“If_Condition_1” Condition=“errcount > 0”>
<ta0:SendEmailActivity SmtpServer="" Subject=“TEST” Authentication=“Version=1,AuthenticationMethod=None” From=“no-reply@” x:Name=“Email_1” MapiServer="" Description=“Send email” BodyFileName=“D:\ToadReports\QMS\CSTA_Errors\CSTA_Errors.html” Cc="" Body="" Bcc="" To="">
ta0:SendEmailActivity.AttachmentFiles
<x:Array Type="{x:Type ta0:FileDescription}" />
</ta0:SendEmailActivity.AttachmentFiles>
</ta0:SendEmailActivity>
</ta0:VariableIfElseBranchActivity>
</ta0:VariableIfElseActivity>
<ta0:LogActivity Message=“test #errcount#” Description=“Write to Log” x:Name=“Log_1” />
</ta:ToadAutomationScript>]]>


#6

The attached text is a truncated version of your script so I could not load it in my TDP 3.2 directly. I tried to recreate a script that is similar to yours instead. Don’t have any problem - condition is evaluated properly. Can you try one more time and send me your original script?

Btw, you don’t need to define errcount variable in a separate SetVariable activity. It is defined and created in Select to File activity.

Igor.


#7

Looks like i only cut off the top line of the xml, so nothing important script wise is missing, that is all that it was doing. I set the variable to see if that would work but it didn’t my initial attempts were just using the defined variable in the select to file and it failed as well. I also tried to have it just evaluate 1=1 and it to came up false. The only thing i can muster is that it is .net 3.5. I have run into toad having several buggy issues with the varying versions of .net. I thought toad 3.2 was compatible with .net 3.5 but it seems there are some bugs. I came to this conclusion after trying it on my local box which has .net 4.5 and it has no issues at all, in fact I just use toad 3.3. But on the server i want to set this up on 3.3 crashes when it runs in batch mode when 4.5 .net isn’t installed. I don’t know how far back in toad versions I would have to go in order to get it working with .net 3.5 so for now I am just going to run them locally until i can get the server upgraded to 4.5.


#8

I can figure out what your script does. As I said, I was able to recreare a similar script which runs for me w/o any problem. But there might be something specific in your script that prevents it from running successfully. Btw, that top line contains vital info including the topmost Description activity which, in turn, contains a lot of script-wide settings.

3.2 should run with .NET 3.5. 3.3 requires .NET 4.0 but I would suggest installing .NET 4.5 on Windows 7 and corresponding Windows Server systems b/c we encounterd some problems in .NET 4.0 when running Automation on W7 + .NET 4.0.

Igor.


#9

Fair enough. Here is the full script, I did rebuild it and simplified it. but it is doing the same thing.

Despite the row_count being set to 1 it translates to false.

A little more info, it is a licensed based version 3.2 Data Point running on MS Server 2008 with .net 3.5. Trying to set it up as a quick ad hoc automated reporting system which toad excels at. Other things are running on the box though which makes it difficult to get them to agree to updating .net anytime soon. So if i can get it working with 3.2 and 3.5 that would be ideal so I dont have to keep my local box running all the time.

TAS Script


<?xml version="1.0" encoding="utf-16"?><![CDATA[](http://schemas.quest.com/ToadAutomation/Plugin">)

<ta0:DefaultDescriptionActivity ScriptVersion=“2.22” Enabled=“True” SmtpServer="" ProdConnection="{x:Null}" Subject=“Automation Script Error” ShowEmailOnErrorWarning=“False” Authentication=“Version=1,AuthenticationMethod=None” From="" LogDir=“D:\ToadReports\QMS\CSTA_Errors” x:Name=“CSTA_Errors” SmtpPort=“25” RelativePath=“False” Mode=“Test” Notes=“Script Attributes” LoggingLevel=“Verbose” Description=“Script Attributes” ScriptName=“CSTA_Errors” ContinueOnError=“stopOnError” UseProjectManager=“True” EmbedSql=“False” Body="" To="" TestConnection="{x:Null}">

ta0:DefaultDescriptionActivity.AttachmentFiles

<x:Array Type="{x:Type ta0:FileDescription}">

<ta0:FileDescription FileName=“D:\ToadReports\QMS\CSTA_Errors\CSTA_Errors.log” />

<ta0:FileDescription FileName=“C:\Users<redacted>\AppData\Roaming\Quest Software\Toad Data Point 3.2\Automation\CSTA_Errors.log” />

</x:Array>

</ta0:DefaultDescriptionActivity.AttachmentFiles>

</ta0:DefaultDescriptionActivity>

<ta1:SelectToExcelActivity x:Name=“File_1” LinkFile=“False” RowCountVar=“RowCount_1” SqlScript=“select sysdate from dual” SqlScriptEmbed="" Description=“Execute SQL and save results to file” Suffix="" ExcelFileName=“D:\ToadReports\QMS\CSTA_Errors\CSTA_Errors.html”>

ta1:SelectToExcelActivity.ExportInstanceOptions

<ns1:ExcelExportInstanceOptions FileOverwrite=“True” FileDirctory=“D:\ToadReports\QMS\CSTA_Errors” FileName=“CSTA_Errors” ExcelFile=“False” xmlns:ns1=“clr-namespace:Quest.Toad.ImportExport;Assembly=ToadCore, Version=6.3.0.916, Culture=neutral, PublicKeyToken=c862883b2ae69822”>

ns1:ExcelExportInstanceOptions.FormatSettings

<ns1:FormatSettings FormatType=“HtmlTable” Row=“1” QuoteChar="’" Column=“1” Delimiter="," FileFilter=“Excel Files (.xls)|.xls” BlockInsertValue=“500.0” FileExtension=“html” FolderImportDirectory="{x:Null}" ExcelAtLocation="{x:Null}" HeaderBackColor=“LightGray” ExcelBeforeExportMacros="{x:Null}" ExcelAfterExportMacros="{x:Null}" />

</ns1:ExcelExportInstanceOptions.FormatSettings>

</ns1:ExcelExportInstanceOptions>

</ta1:SelectToExcelActivity.ExportInstanceOptions>

ta1:SelectToExcelActivity.ConnectionDescription

<ta1:ConnectionDescription Trl=“oracle://” Description="" IsNullPassword=“False” NodePath=“Oracle<redacted>” />

</ta1:SelectToExcelActivity.ConnectionDescription>

</ta1:SelectToExcelActivity>

<ta0:VariableIfElseActivity x:Name=“If_1”>

<ta0:VariableIfElseBranchActivity x:Name=“If_Condition_1” Condition=“RowCount_1>0”>

<ta0:LogActivity Message=“Success” Description=“Write to Log” x:Name=“Log_1” />

</ta0:VariableIfElseBranchActivity>

</ta0:VariableIfElseActivity>

</ta:ToadAutomationScript>]]>


I had it verbose log and here are the results.

– 9/30/2013 6:00:44 PM: CSTA_Errors.log: Setting up environment

– 9/30/2013 6:00:44 PM: CSTA_Errors.log: Script run by Toad Data Point 3.2.0.916

– 9/30/2013 6:00:44 PM: CSTA_Errors.log: Build started

– 9/30/2013 6:00:44 PM: CSTA_Errors.log: Compiling Script

– 9/30/2013 6:00:47 PM: CSTA_Errors.log: Build Completed

– 9/30/2013 6:00:47 PM: CSTA_Errors.log: Begin execution script activities

– 9/30/2013 6:00:47 PM: CSTA_Errors.log: Begin Export of File_1

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Connection To:

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Connection successful

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Connection logon:

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Last schema:

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Default schema:

– 9/30/2013 6:00:50 PM: CSTA_Errors.log: Auto Commit: True

– 9/30/2013 6:00:51 PM: CSTA_Errors.log: SQL to execute: select sysdate from dual

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:51 PM Thread (12) Adding Export Notification Subscriber {0}

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:51 PM Thread (12) Export Started [9/30/2013 6:00:51 PM]

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:51 PM Thread (12) ** START **

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:51 PM Thread (12) Export using connection:

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:51 PM Thread (12) Export using connection:

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:52 PM Thread (12) Export Wizard: Building object list

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:52 PM Thread (12) Build List done.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:53 PM Thread (12) Exporting Data (1 of 1)

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:53 PM Thread (12) BEGIN Query :

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:53 PM Thread (12) Object SQL Query started.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (17) InternalReadBackground - start

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (17) InternalReadBackground - after ExecuteReader - command select sysdate from dual

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (18) DoneReadTreadWriter

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (18) Writing rows 0 - 1

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (18) Writing rows Finalize

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (18) DoneReadThreadWriter finally - adapter.RowsRead 1

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (12) END Query :

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:54 PM Thread (12) Object SQL Query finished.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:55 PM Thread (12) Export Finished [9/30/2013 6:00:55 PM]

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Thread (12) Build Time 00:00:01.9687626

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Thread (12) Complete Time 00:00:04.1562766

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: 6:00:55 PM Thread (12) ** END **

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Attempted to export 1 rows.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Successfully exported 1 rows.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Export Finished, click CSTA_Errors.html to view file.

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Row count variable RowCount_1 set to 1 rows

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Condition: “RowCount_1>0” evaluated to False. Child activties will not be executed

– 9/30/2013 6:00:55 PM: CSTA_Errors.log: Done