Hi Ive got a few sql functions
Code:CREATE FUNCTION getItemsFromAccount( @accountName varchar(300) ) RETURNS varbINARY(1920) BEGIN declare @BinaryVariable2 varbINARY(1920) set @BinaryVariable2 = (select items from warehouse where AccountId=@accountName); return @BinaryVariable2 ENDThe first function is working as expected when i call it usingCode:CREATE FUNCTION getItemsFromCharIndex( @hexItemCode varbinary(20) ) RETURNS varbINARY(1920) BEGIN declare @BinaryVariable2 varbinary(1920); set @BinaryVariable2 = (select items from warehouse where (charindex @hexItemCode, Items) %16=4)); return @BinaryVariable2 ; END
I recieve the full varbinary resultCode:$ci = $db->Execute("SELECT [dbName].[dbo].[getItemsFromAccount]('TestUser');"); $ci = $res->fetchrow();
The second function called using
I receive only a partial resultCode:$ci = $db->Execute("SELECT [dbName].[dbo].[getItemsFromCharIndex](0x00C93119)"); $ci = $res->fetchrow();
Ive tested this via the sql query analyzer and it returns the partial result there as well
Does anyone know a way to fix my sql function to make it return the entire varbinary result
testing the result in query analyzer using print(@varible) produces the correct results
ie
returns the correct results but i cant access the print value from outside the query analyzerCode:declare @result varbinary(1920); set @result = (SELECT [MuOnline].[dbo].[getItemsFromCharIndex](0x00C93119)); print @result;
Thx for helping


Reply With Quote