Question Form to retrieve data from a stored procedure and then update from another one

Mofoquer

New member
Joined
Jul 20, 2011
Messages
1
Programming Experience
1-3
Hello all,

Beginner question:
I have a stored procedure to search for a data and another procedure to update the data using the results from the search.

This is the Search Procedure:


And this is the update procedure:

PROCEDURE ACTUALIZA_GESTION(P_NUM_TERM IN NUMERIC,
                            P_NUM_LOTE IN NUMERIC)
AS
BEGIN

     UPDATE TRANSACC_INGENICO X SET X.TRANSFER = 'T'
     WHERE X.OFICINA = P_NUM_TERM AND X.LOTE = P_NUM_LOTE AND X.TRANSFER = 'P';

END ACTUALIZA_GESTION;


So, what i want to know is how can i create a form in with a search button in vb that displays the results from the search procedure, and then, with the results, to be able to select the row that i want from the results with an update button, that calls the other procedure that updates the status from P to T of the row.

Any help is greatly appreciated
 
'exec YourSpName' is the sql code that will return the data you would like to use. You either fill a dataset with this command or use a datareader to perform the operations you want. You could then use executenonquery on the command object to update the database or call another stored proc as needed. ExecuteNonQuery will not return a result set but the number of rows affected. ExecuteReader will return a datareader. To fill a dataset you will need a data adapter.
 

Latest posts

Back
Top