Welcome Guest, Not a member yet? Register   Sign In
Problem with calling Store Procedure with Temp Table
#1

[eluser]Unknown[/eluser]
I have simple SP like this:

CREATE PROCEDURE TEST
AS
BEGIN
SELECT 'aaaaaaaaaaaaaaa' AS Name INTO #Temp
SELECT * FROM #Temp
DROP TABLE #Temp
END

php code:
$query = $this->db->query("EXEC TEST");

if ($query->num_rows() > 0)
{
foreach ($query->result() as $row)
{
$data[] = $row;
}
return $data;
}
else
{
return false;
}

It doesn't work and it still works well if I don't use #Temp in SP.
Doesn't any one have solution to use #Temp in SP?

Thanks!
#2

[eluser]Alucemet[/eluser]
Why not CALL test instead of EXEC test?




Theme © iAndrew 2016 - Forum software by © MyBB