473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

execute simple SP

Hello all!

I have a store proceudre that when it runs, it turns a 0 into a 1. Just one
row, one value. I'm kinda of using it a check point. So the procedure
returns no value at all. I want to just have a button click execute my
procedure. Do I still use non-query, or how would I write that to execute
it. I know I need the connection and stuff, just not sure how to execute it.
Thanks!

Rudy
Jul 6 '06 #1
2 1091
Hi,

use command object to execute SP. on the ExecuteNonQuery() method which
will return integer value that how many rows are affected. otherwise
you can set commandText property as 'exec spName'. and execute it by
ExecuteScalar() method which will return first field of first row. that
is single value which u want.

others alternatives also are there, like you can assign it to dataset
during execution.. etc.

I think you are satisfy with this answer.
Mohan
mo********@gamil.com
Rudy wrote:
Hello all!

I have a store proceudre that when it runs, it turns a 0 into a 1. Just one
row, one value. I'm kinda of using it a check point. So the procedure
returns no value at all. I want to just have a button click execute my
procedure. Do I still use non-query, or how would I write that to execute
it. I know I need the connection and stuff, just not sure how to execute it.
Thanks!

Rudy
Jul 6 '06 #2
Thank you ohanaryal! Worked perfect!

"mo********@gmail.com" wrote:
Hi,

use command object to execute SP. on the ExecuteNonQuery() method which
will return integer value that how many rows are affected. otherwise
you can set commandText property as 'exec spName'. and execute it by
ExecuteScalar() method which will return first field of first row. that
is single value which u want.

others alternatives also are there, like you can assign it to dataset
during execution.. etc.

I think you are satisfy with this answer.
Mohan
mo********@gamil.com
Rudy wrote:
Hello all!

I have a store proceudre that when it runs, it turns a 0 into a 1. Just one
row, one value. I'm kinda of using it a check point. So the procedure
returns no value at all. I want to just have a button click execute my
procedure. Do I still use non-query, or how would I write that to execute
it. I know I need the connection and stuff, just not sure how to execute it.
Thanks!

Rudy

Jul 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
2
by: michaaal | last post by:
I feel a bit silly asking this because I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands). ...
11
by: penguinman | last post by:
I type ./a.out and the shell just sits there. It doesnt hang it just sits there looking pretty. I run the program with the ddd option and executed it from ddd...execution window comes up and...
1
by: maciek zywno | last post by:
Hi, I am trying to execute a simple sql file thru ant task. The file is: use GO However I get the errror message: Failed to execute: use GO
5
by: Gustavo Randich | last post by:
Hello, I'm writing an automatic SQL parser and translator from Informix to DB2. Now I'm faced with one of the most difficult things to translate, the "foreach execute procedure" functionality...
3
by: Lyle Fairfield | last post by:
MS-SQL Server utilities Enterprise Manager and Query Analyzer will model almost any MS-SQL object as a simple script file with a default ".sql" extension. But how to "run these files? They are...
3
by: RAG2007 | last post by:
I'm using the QueryDef and Execute method to update a record in my MySQL backend. Problem: When the Passthrough update query is defined using QueryDef, it becomes a select query, and I cannot use...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
6
by: Oliver | last post by:
I'm fairly new to DB2. I have been assigned to build a delete trigger that finds the data type of each of the table's fields so that the trigger can then build a string consisting of OLD values...
5
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.