PDA

View Full Version : no record returns from stored procedure



mandal
26th April 2007, 14:45
we have created a stored procedure in in sql server 2005.

pseudocode for sp:
create proc sp_test
@id int
as
begin
insert into tbl_Log select name from tbl_test where id=@id;
select name from tbl_test where id=@id;
end
stored procedure works properly on sql server 2005.

and in c++ code i create a QSqlQuery.

mSqlQuery->prepare("{call sp_test(?)}");
mSqlQuery->addBindValue(parameter, QSql::In);//parameter is assigned before
mSqlQuery->exec();

Although my query is active and insert statement in stored procedure is executed no record returns from sp_test execution.mSqlQuery.next() returns false.

Any suggestions to solve that problem..
Thanx in advance...