SQLUSE [OIK]GO DECLARE @return_value intEXEC @return_value = [dbo].[Step] @Cat = N'I', @Ids = N'30568', @Start = N'2017-03-01 11:00:00.000', @Stop = N'2017-03-01 14:30:00.000', @Step = 60 SELECT 'Return Value' = @return_value GO
C++ (Qt)...if (db.open()) { QString q; QSqlQuery query(db); q.sprintf("CALL dbo.Step(%s, %s, %s, %s, %d)", "S", "11", "2017-03-01 11:00:00.000", "2017-03-05 00:00:00.000", 60); qDebug() << query.exec(q);}
C++ (Qt)query.prepare("Call dbo.Step(?, ?, ?, ?, ?)");query.addBindValue("S");....query.exec();
C++ (Qt)QSqlQuery query(db);query.prepare("CALL dbo.Step ( ?, ?, ?, ?, ? )");query.addBindValue("S");query.addBindValue("11");query.addBindValue("2017-03-01 11:00:00.000");query.addBindValue("2017-03-05 00:00:00.000");query.addBindValue(60);qDebug() << query.exec();
C++ (Qt)qDebug () << query.lastErro().text()
C++ (Qt)QSqlQuery query(db);query.exec("call [dbo].[GetCurrentDate_ForKU]"); // пробовал различные варианты записи qDebug () << query.lastError().text();
QTDS: General SQL Server error: Check messages from the SQL Server
C++ (Qt)QSqlQuery query(db);query.setForwardOnly(true);query.prepare("exec [dbo].[Step] ?, ?, ?, ? ,?");query.addBindValue("B");query.addBindValue("11");query.addBindValue("2017-03-01 11:00:00.000");query.addBindValue("2017-03-05 00:00:00.000");query.addBindValue("60");query.exec();
for (int i = 0; i < queryParameters.size(); i++) lQueryText.replace(queryParameters.keys().at(i), queryParameters.value(queryParameters.keys().at(i)));