USE [SomeDB]
GO
/****** Object: StoredProcedure [dbo].[ins_new_importIDocInfo] Script Date: 12/6/2019 7:46:07 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[ins_new_importIDocInfo]
@StoreId int,
@Supplier nvarchar(50),
@IDoc nvarchar(50),
@AmtRcvd money,
@DateRcvd datetime,
@RECID INT OUTPUT as
Insert Into importIDocInfo(StoreId,Supplier,IDoc,AmtRcvd,DateRcvd)
Values(@StoreId,@Supplier,@IDoc,@AmtRcvd,@DateRcvd)
SELECT @RECID = SCOPE_IDENTITY()
RETURN @RECID
$myparams['RECID'] = intval(-2);
$myparams['StoreId'] = $srtStoreId;
$myparams['Supplier'] = $supplier;
$myparams['IDoc'] = $wrkIDOCNbr;
$myparams['AmtRcvd'] = $strChkTotalMoney;
$myparams['DateRcvd'] = $wrkFixedEmailSentDate;
$procedure_params = array(
array(&$myparams['RECID'], SQLSRV_PARAM_OUT),
array(&$myparams['StoreId'], SQLSRV_PARAM_IN),
array(&$myparams['Supplier'], SQLSRV_PARAM_IN),
array(&$myparams['IDoc'], SQLSRV_PARAM_IN),
array(&$myparams['AmtRcvd'], SQLSRV_PARAM_IN,null,SQLSRV_SQLTYPE_MONEY),
array(&$myparams['DateRcvd'], SQLSRV_PARAM_IN,null,SQLSRV_SQLTYPE_DATETIME));
$myconnect = sqlsrv_connect($sname,$wrkinfo);
$sqltxt = "EXEC ins_new_importIDocInfo @RECID= ?, @StoreId= ?, @Supplier= ?, @IDoc= ?, @AmtRcvd= ?, @DateRcvd= ? ";
$mystmt = sqlsrv_prepare($myconnect,$sqltxt, $procedure_params);
if ($mystmt == false)
{
trigger_error(sqlsrv_errors(), E_USER_ERROR);
print_r($myparams);
(print_r(sqlsrv_errors(), true));
sqlsrv_free_stmt($mystmt);
sqlsrv_close($myconnect);
echo 'ERROR ** UNABLE TO CREATE IMPORTIDOCINFO RECORD';
}else{
if (sqlsrv_execute($mystmt))
{
while ($res = sqlsrv_next_result($mystmt))
{
}
// print_r($myparams);
// print_r(sqlsrv_errors(), true);
$primaryid = $myparams[@RECID];
}
}
sqlsrv_free_stmt($mystmt);
sqlsrv_close($myconnect);
// echo 'Primary Key Returned ' . $primaryid . '<BR><br>';
return $primaryid;
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE