@uday_guntupalliThanks for your solution.
I tried to apply your advice but it didn't work. :\
1. The Query works - When I insert numbers in a script and don't variables from the user. For examples - Instead of foo[1], I insert p123 and Instead of oo[2], I insert v123.
dt_ScadaData = Open Database("DRIVER=SQL Server;SERVER=My Server ;Trusted_Connection=Yes",
"DECLARE @StartDateTime datetime = DATEADD(day, -1, CAST(GETDATE() AS varchar(11))) -- 17 Days Back
DECLARE @EndDateTime datetime = DATEADD(day,1, GETDATE())
EXEC ListData @Criteria='
<ScadaPortal>
<Data Name=\!"PointData\!" Format=\!"Wide\!" Interval=\!"60m\!">
<Where>
<Column Name=\!"Point\!" Project=\!"p123\!" Value=\!"v123\!"/>
</Where>
</Data>
</ScadaPortal>'
, @StartDateTime=@StartDateTime
, @EndDateTime=@EndDateTime","Scada Data");
2. The log -
foo = {"P123", "V123"};
//:*/
LB = Lineup Box(1);
LB << Append(
PB_Inputs = Panel Box("User Inputs",
a = Text Edit Box( "" ), //foo[1]
b = Text Edit Box( "" ), // foo[2]
);
);
MyUI = V List Box(LB,
BB_UserInputUnload = Button Box("Ok",
foo = Eval List( {a << get text, b << get text} );
Show( foo );
q_str ="DRIVER=SQL Server;SERVER=My Server;Trusted_Connection=Yes",
"DECLARE @StartDateTime datetime = DATEADD(day, -1, CAST(GETDATE() AS varchar(11))) -- 17 Days Back
DECLARE @EndDateTime datetime = DATEADD(day,0, GETDATE())
EXEC ListData @Criteria='
<ScadaPortal>
<Data Name=\!"PointData\!" Format=\!"Wide\!" Interval=\!"60m\!">
<Where>
<Column Name=\!"Point\!" Project=\!"^foo[1]^\!" Value=\!"^foo[2]^\!"/>
</Where>
</Data>
</ScadaPortal>'
, @StartDateTime=@StartDateTime
, @EndDateTime=@EndDateTime","Scada Data";
Show(q_str);
q_str = Eval Insert INTO(q_str);
Show(q_str);
),
);
NW = New Window("User Input Collection Window",
VLB = V List Box();
);
VLB << Append(MyUI);
/*:
3. Can you see the script in chapter 2 that I apply your advice, If I understood you correctly.