-- 查看函数和过程的状态
select object_name,status from user_objects where object_type='FUNCTION';
select object_name,status from user_objects where object_type='PROCEDURE';
-- 查看函数和过程的源代码
select text from all_source where owner=user and name=upper('&plsql_name');
$serverName = "(local)";
$connectionInfo = array( "UID"=>"sa",
"PWD"=>"123456",
"Database"=>"book",
"CharacterSet" => "UTF-8");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Could not connect.\n";
die( print_r( sqlsrv_errors(), true));
}
$tsql_callSP = "{call pro_test( ?, ?)}";
@p1 = "11";
@p2 = "xiaoli";
$params = array( @p1,@p2 );
$stmt = sqlsrv_query( $conn, $tsql_callSP, $params);
echo "Rows affectd: ".sqlsrv_rows_affected($stmt)."-----\n";
$next_result = sqlsrv_next_result($stmt);
if( $next_result )
{
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC))
{
echo "ReviewerName: ".$row[0]."\n";
}
}
elseif( is_null($next_result))//判断出来总是到这里,为空,求解?
{
echo "No more results.\n";
}
else
{
echo "Error in moving to next result.\n";
die(print_r(sqlsrv_errors(), true));
}
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);