while ($csv = odbtp_fetch_row($SQLResult))
{
$dat=date('d/m/y',strtotime(substr($csv[0],0,$cutoff)));
echo str_replace(" ","/",$dat).",".$csv[1].",".$csv[2].",".$csv[3].",".$csv[4].",".$csv[5]."\r\n";
}
when the stored procedure looks like:
select top 5 * from _tbl_INDEXFIXINGS
or
select top * from IndexFixings
but when there is an insert in the procedure like:
insert into _tbl_INDEXFIXINGS
select top 5 * from IndexFixings where EvalDate=>@DateBack and EvalDate<@LAST
select top 5 * from _tbl_INDEXFIXINGS
it does not work, there is no data send back to the php site
(but he makes the insert on the MSSQL Server)
I don't think that this is a problem with the permissions
please help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem is most likely the result of not retieving the affected row count generated by the INSERT. You will need to use odbtp_next_result(). This function is required to proccess transactions that generate multiple results. To avoid this, include the following statement at the top of your proc:
SET NOCOUNT ON
This will suppress the generation of affected row counts.
-- bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
php code workes fine:
$SQLQuery = "proc_".$proc."_Web_o @Subscriber='".$usersid."', @DaysBack=".$time.";";
$SQLResult = odbtp_query($SQLQuery);
while ($csv = odbtp_fetch_row($SQLResult))
{
$dat=date('d/m/y',strtotime(substr($csv[0],0,$cutoff)));
echo str_replace(" ","/",$dat).",".$csv[1].",".$csv[2].",".$csv[3].",".$csv[4].",".$csv[5]."\r\n";
}
when the stored procedure looks like:
select top 5 * from _tbl_INDEXFIXINGS
or
select top * from IndexFixings
but when there is an insert in the procedure like:
insert into _tbl_INDEXFIXINGS
select top 5 * from IndexFixings where EvalDate=>@DateBack and EvalDate<@LAST
select top 5 * from _tbl_INDEXFIXINGS
it does not work, there is no data send back to the php site
(but he makes the insert on the MSSQL Server)
I don't think that this is a problem with the permissions
please help
The problem is most likely the result of not retieving the affected row count generated by the INSERT. You will need to use odbtp_next_result(). This function is required to proccess transactions that generate multiple results. To avoid this, include the following statement at the top of your proc:
SET NOCOUNT ON
This will suppress the generation of affected row counts.
-- bob
thanks for the help "set nocount on" works fine!