Calling MSSQL stored procedure from InTouch

twibs

Member
Join Date
Feb 2014
Location
Satakunta
Posts
8
Hello, I'm trying to call the following procedure from my Intouch

Code:
    SET NOCOUNT ON;
    delete from dbo.RoadmapTemp
    insert into dbo.RoadmapTemp
    select * from dbo.Roadmap

Which clears the data in table and writes new ones on it.

The following query work when used from the SQL server management studio

Code:
exec [9913EMS].dbo.RoadmapToTemp

But when trying to use it in InTouch I don't see any problems, but no results either.

Code:
SQLSetStatement(ConnectionId, "exec [9913EMS].dbo.RoadmapToTemp" );

SQLExecute(ConnectionId, "", StatementID);

I tried it with prepare statement also, but no use. Also it seems to require the "", in the middle, since leaving it out only results in "cannot mix string".

Any ideas.
 
No need. It was an permission error in the database end. Added execute permissions and voila.

Too much thinking, forgot to follow the execute statement SQLresult. Doh...
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
189
I am looking to get an AB series 1774 (PLC1) from the 1970's up and running. I have all the parts, and it powers up just fine without errors if I...
Replies
12
Views
2,357
Hello all, I’ve recently begun using Automation Studio on my own time to boost my knowledge of controllers beyond AB/Siemens. To ease myself into...
Replies
0
Views
923
Hello I'm new to PLC programming and I'm programing in ST. Programming envirement is GX works 3. I can't figure out how to jump to subprogram or...
Replies
1
Views
1,481
I have some code i need to block until a super genie for data entry has completed (by operator input)as per below. FUNCTION New_Setpoint()...
Replies
5
Views
2,287
Back
Top Bottom