473,767 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help for this pls stored procedure

In my stored procedure i have :
EXECUTE ('select ' + @TotalRecords + ' = count(*) from clients')

It doesn't work!
and i don't know how i can ?

Apr 17 '06 #1
1 1152

No this doesn`t work :-)

as with a execute statement you are now creating the following string to
execute 'select = count(*) from clients'
so it will result in an error

if it is so that the stored procedure itself should return this value then

SELECT COUNT(*) FROM clients should do the trick

if it is your intention that the variabel @TotalRecords should hold the
value then

SELECT @TotalRecords=C OUNT(*) FROM clients

wil do what you want

you may also perform anny select query and then read the @@ROWCOUNT value

HTH

Michel Posseth [MCP]

"sebastien1 101" <se***********@ hotmail.fr> schreef in bericht
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
In my stored procedure i have :
EXECUTE ('select ' + @TotalRecords + ' = count(*) from clients')

It doesn't work!
and i don't know how i can ?

Apr 17 '06 #2

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

Similar topics

2
4705
by: berthelot samuel | last post by:
Hi everyone, I am currently trying to write a report based on a View of SQL Server. Basically, I have 3 tables : Hardware, SoftwareInstalled and Software with SoftwareInstalled that keeps track of all the software installed on each piece of hardware by referencing the primary keys of each table. So now, I have a request that retrieve information from those 3 tables giving a list of all the hardware with their details + the software...
1
1315
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to update one of the columns called Status from "incomplete" to "Pending" Status is one of the parameters for stored procedure #1. This all works fine, My problem is after the person is finished with the record they then push the next button to get...
2
5728
by: Caro | last post by:
I have a stored procedure spGetAccessLogDynamic and when I try to call it I get the following error: Server: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'S'. I dont know why because I dont have anything refering to stored procedure 'S' I have ran my SQL String with sample values and it works fine. So I
1
2000
by: Kumar | last post by:
Hi I am trying to recreate a database under the following environments : From: Solaris with DB2UDB version 7.2 with FP 9 To: Linux with DB2UDB version 7.2 with FP 9 It will be of really a great help if any one help me in step-by-step guidelines to migrate SPs written in Java & C languages. I have successfully recreated SQL procedures.
0
921
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to update one of the columns called Status from "incomplete" to "Pending" Status is one of the parameters for stored procedure #1. This all works fine, My problem is after the person is finished with the record they then push the next button to get...
2
1164
by: I am Sam | last post by:
Ok I set up a button column to delete an individual record. Nothing happens when I test it. Someone please help understand why. Below is the associated coding: DataGrid control: <asp:datagrid id="clubdg" DataKeyField="UserID" runat="server" GridLines="Vertical" CellPadding="2" BorderWidth="1px" BorderColor="#CCCCFF" CssClass="txt" AutoGenerateColumns="False" OnCancelCommand="Cancel_Click"
2
1052
by: Ken | last post by:
Hello, I have a webform that gets a record from SQL Server by using a stored procedure. The stored procedure uses 3 parameters in which after the record is found, stored procedure #2 runs to update one of the columns called Status from "incomplete" to "Pending" Status is one of the parameters for stored procedure #1. This all works fine, My problem is after the person is finished with the record they then push the next button to get...
3
4097
by: Darth Ferret | last post by:
This thing is about to drive me crazy. I have about 50 queries in the AS400 that I need to put on a menu. Once I conquer this I have a bunch more rpg reports that I need to pass a date to. In the AS400 I have a stored procedure (SPRUNQRY) that runs the RUNQRY command with the name of the query as a parameter. In the AS400 I would type "RUNQRY SUNTR401A" on a command line to run this query. My connection is opening, and I can run some...
17
4013
by: Riaaaa | last post by:
Pls check my code for the stored procedure which i created for the companydetails including companyid P.K. Not Null int(4), companyname Not Null varchar (20), address varchar(30) where companyid is the primary key and it should be autogenerate.
0
3192
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works fine. Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB for LUW 9.5.
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10013
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8838
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7383
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.