你好我一直在努力解决这个问题,Store程序执行但是当我在PHP上运行它时没有返回任何消息但是当我在SQL管理工作室运行它时它会返回消息我希望有人可以帮我看看附加的代码< / p>
SP
If(@Type='2') -- Update
Begin
If (@idpn='')
Begin
Select 'Please select a P/N!' As [Message], '0' As [IsPass]
Return;
End
If (@iecpn='')
Begin
Select 'Please enter an IECPn!' As [Message], '0' As [IsPass]
Return;
End
If (@hppn='')
Begin
Select 'Please enter an HPPn!' As [Message], '0' As [IsPass]
Return;
End
If (@location='')
Begin
Select 'Please enter a location ['+@location+']!.' As [Message], '0' As [IsPass]
Return;
End
If (@MaxQty='')
Begin
Select 'Please enter a MaxQty ['+@MaxQty+']!.' As [Message], '0' As [IsPass]
Return;
End
If (@MinQty='')
Begin
Select 'Please enter a MinQty ['+@MinQty+']!.' As [Message], '0' As [IsPass]
Return;
End
If (@PNDescription='')
Begin
Select 'Please enter a Description ['+@PNDescription+']!.' As [Message], '0' As [IsPass]
Return;
End
If Not Exists (Select * From WHS_MaterialMaster (NoLock) Where Id=@idpn and Status='1')
Begin
Select 'This P/N:['+@hppn+']-['+@iecpn+'] does not exists. Please verify it!' As [Message], '0' As [IsPass]
Return;
End
Set @descr='Max='+isnull(@MaxQty,'')+'~Min='+isnull(@MinQty,'')+'~Rack='+isnull(Left(@location,1),'')+'~Drawer='+isnull(Substring(@location,2,2),'')+'~Level='+isnull(Right(@location,1),'')+'~'
Update WHS_MaterialMaster set IECPartNo=@iecpn,CPQPartNo=@hppn,PartDesc=@PNDescription,Qty=@StrQty,Description=@descr,Editor=@Editor,Udt=@datetime
Where Id=@idpn and Status='1'
Insert Into IMXPRD.dbo.GlobalHistory (ItemId,Program,[Function],[Description],[User],WorkStation,[Type],Editor,Cdt,Udt)
values (@idpn,'WHSInventory','WHSOperation',isnull(@iecpn,'')+'~'+isnull(@hppn,'')+'~'+isnull(@PNDescription,'')+'~'+isnull(@StrQty,'')+'~'+isnull(@descr,'')+'~'+@location,@Editor,@Hostname,'UPDT',@Editor,@datetime,@datetime)
Select 'This P/N:['+@hppn+']-['+@iecpn+'] has been updated. Please verify it!.' As [Message], '1' As [IsPass]
Return;
PHP代码
$sql ="exec sp_IMX_WHSInventoryKanban_md '215','WC0537006001','635199-001','A01A','99','110','10','Este N/P es para prueba del sistema de WHS!!!','','ISA100115','IMX-100115-01','2'";
$stmt = sqlsrv_query($this->conn, $sql );
$json = array();
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
$json['tMaterialMaster'][]=$row;
}
echo json_encode($json);