Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters in a stored procedure
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01121840
Message ID:
01121841
Views:
18
What following returns:
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.
>However, trying it from VFP fails and I have no clue why.
>
>This is what the profiler is telling me when the application is uploading:
>
>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
>
>
>When starting the SP from VFP the profiler is only returning:
>
>EXEC addObject @objectname = '360031', @objecttype = 'P'
>
>
>My upload is doing this:
>
>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
>
>
>The SQLexec get called and in the SQL Profiler I also see that the SP is fired but the profiler is returning different things to me. What is creating this in the profiler?
>
>declare @P1 varchar(100)
>set @P1=NULL
>declare @P2 int
>set @P2=NULL
>
>
>The SP starts with
>
>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
>
>
>
>Any suggestions are welcome.
>
>Thanks in advance,
>Ron
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform