SQL

I'm trying to save data to MS SQL using the created procedure, but nothing happens. I am getting the following error message:
SQL Error: Area=GetData, Context=, ContextHandle=0, Description=ExecuteReader: CommandText property has not been initialized, Error=4, ErrorDescription=Database error
What could be the problem?
Procedure:
CREATE PROCEDURE TestSelect
-- Add the parameters for the stored procedure here
@LoadArmID nvarchar(32)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO Accuload2(LoadArmID) VALUES (@LoadArmID)
END
GO
Cicode:
FUNCTION
ReportToSQL2();

INT hSQL;
INT hStmt;

hSQL = SQLConnect("SCADA Data Provider=SQLClient;Server=SRV-SCADA;Initial Catalog=CitectSQL;Persist Security Info=False;Integrated Security=True;User Id=Citect;Password=Pass;");

IF hSQL <> -1 THEN

hStmt = SQLQueryCreate(hSQL);

SQLSet(hStmt, "EXECUTE TestSelect @LoadArmID='Test'");
// SQLParamsSetAsString(hStmt, "LoadArmID", sLoadArmID);
SQLExec(hSQL, "");
SQLDisconnect(hSQL);

ELSE

Message("Information", SQLErrMsg(), 48);

END
END
Parents Reply Children
No Data