result = '' NewObjectID = 0 cQuery = ; [EXEC addObject] + ; [ @objectname= '] + ALLTRIM(tmpProducts.prcode) + ['] + ; [,@objecttype= 'P'] * may be caused by Question marks in the cQuery! nResult = SQLExec(x.GETnHandle(), cQuery) IF nResult < 0 AERROR(laError) MessageBox(laError[1,2]) ENDIF>I want to fill a database used by a DotNet program. For that I use one of the stored procedures because I have seen with the profiler that the application is also using.
>declare @P1 varchar(100) >set @P1=NULL >declare @P2 int >set @P2=NULL >exec AddObject @ObjectName = '762061', @ObjectType = 'P', @Result = @P1 output, @NewObjectID = @P2 output >select @P1, @P2 >>
>EXEC addObject @objectname = '360031', @objecttype = 'P' >>
>Result = '' >NewObjectID = 0 >cQuery = ; > [EXEC addObject] + ; > [ @objectname= '] + ALLTRIM(tmpProducts.prcode) + ['] + ; > [,@objecttype= 'P'] >TRY > * may be caused by Question marks in the cQuery! > nResult = SQLExec(x.GETnHandle(), cQuery) >CATCH TO oError > nResult = 0 >ENDTRY >>
>declare @P1 varchar(100) >set @P1=NULL >declare @P2 int >set @P2=NULL >>
>create proc AddObject >@ObjectName varchar (255), >@ObjectType char(1), >@Result varchar(100) output, >@NewObjectID int output >as >/* add a new object to the Property table */ >-- check Objecttype >if @ObjectType not in ('S', 'P', 'M', 'C', 'R', 'A', 'T' ) >begin > set @Result = 'ERROR: Invalid Object Type' > return >end > >>