on 10-08-2014 1:00 PM
My code is as follows
DECLARE spgetname PROCEDURE FOR spGetName @Customer = :ls_customer, @Type = :ls_type, @CName = :ls_name OUTPUT USING SQLCA; EXECUTE spgetname ; do while sqlca.sqlcode = 0 FETCH spgetname INTO :s_message; if sqlca.sqlcode = 0 then MessageBox( "s_message", s_message) end if Loop
I am using pb11.2 and SqlServer snc connection. the procedure is not calling. Even when I am giving wrong procedure name , no error message is coming. Please looking for your help Regards Pol
What Paul said. But let's take a step back. What does your procedure return to the application? Is it a resultset? an output argument? the return value? All three? More than one but less than three? It is best to pick most appropriate implementation in order to make things easier (and safer and more efficient) for the application.
Next, you need to learn to code defensively. Don't assume that every call succeeds. You check for an error once in your code yet there are multiple functions that can fail. Using dynamic sql in PB is very different from using a datawindow control - there is no default implementation that will automatically display error messages when a function returns an error, you must write code to do that. I'll also point out that you can trace your database connection - something that can be very useful when you are experiencing unexplained connectivity problems.
Lastly, you've posted a series of questions about RPCs, stored procedures, sql server and PB. A few seem to revolve around the idea that you want to avoid declaring the RPC in your application for some strange reason. I think it would be good to explain your reasoning since the RPC approach is the easiest to implement BY FAR (assuming that your procedure does not return a resultset).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll never understand why people continue to use the embedded SQL method for calling stored procedures. Old habits die hard, I guess...
I write all mine with input parameters only (no output parameters, EVER) and have them return a result set with a final SELECT statement. Then I use a datawindow to invoke it with the Retrieve() method.
No messy embedded SQL, and having to get the syntax of the Declare/Execute/Close statements just perfect. And no Fetch loops because you have the full power of the dw Primary buffer at your disposal.
-Paul-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.