41280members
184211posts

[Imported] QueryPad Executing Bulk INSERT Statements

Highlighted
Sisko

[Imported] QueryPad Executing Bulk INSERT Statements

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-25 19:58:51 Id:293
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

-------------------------------
**_nminchin:_**
**_I have 2,700 insert statements that I want to execute in QueryPad, except when I try even 2 at once, I get an error:_**

**_*** Prepare failed - Query error. ***_**
**_*** Unexpected (Line = 2, Col = 1) ***_**

**_which points to the start of the 2nd insert statement... Which makes me think that it's not possible to execute multiple statements in the one execution..._**

**_Is this correct? Or can I add a delimiter (;??) to the end of each statement to execute them one-by-one?_**

**_Cheers!_**

-----------------------

bevanweiss:
Hey Nick,
This is a deliberate limitation to the ClearSCADA Query Processor.
In talks with Schneider, they will not change this anytime soon, it is considered something of a 'safety feature' as it prevents the Little Bobby Tables scenario....

--------------------

AWoodland:
Does it HAVE to be QueryPad, couldn't using vbscript and Server.Query do what you want?

I use Sublime when I need to bulk edit rows (i.e. to add Something = Server.Query(" to the start of each line, and ") to the end)

-----------

**_nminchin:_**
**_Thanks guys._**

**_Adam: yep, I think I'll need to resort to using VBScript. I was hoping for something quick and simple so that I didn't have to code anything. I would normally use a spreadsheet AI tool I wrote, but they don't have Excel on the server :)_**

--------------

davidhopkins:
For this kind of requirement, the ClearSCADA .NET API (combined with LINQPad or Visual Studio Code for a light but powerful code editor) is the bee's knees. You can get a lot done very quickly, you can use C# and Linq, the IntelliSense is really good. Much better than the VBscript COM API.

Visual Studio Code even gives you the IntelliSense for free (it's a paid feature in LINQPad).