473,395 Members | 1,790 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,395 software developers and data experts.

Problem in stored procedure in the last line plz help

HI here is the stored procedure

CREATE Procedure dm_deleteBBPost
(
@TopicID numeric,
@ForumID numeric

)
As
declare @netCount as int

BEGIN
Select @netCount=count(*) from tblBBPosts where TopicID=@TopicID

update tblBBForums set TotalTopics=TotalTopics-1,TotalPosts=TotalPosts-@netCount where ForumID=@ForumID

Delete From tblBBPosts Where TopicID = @TopicID
Delete From tblBBTopics Where TopicID =@TopicID

end
declare @pr_ForumsToday as varchar
declare @topicname as varchar

SELECT TOP 1 @topicname=Topics FROM tblBBTopics ORDER BY LastPostDate DESC
@pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
GO



i am getting error in the @pr_ForumsToday line
syntax error i think plz can any body help
Jul 19 '07 #1
1 928
ck9663
2,878 Expert 2GB
HI here is the stored procedure

CREATE Procedure dm_deleteBBPost
(
@TopicID numeric,
@ForumID numeric

)
As
declare @netCount as int

BEGIN
Select @netCount=count(*) from tblBBPosts where TopicID=@TopicID

update tblBBForums set TotalTopics=TotalTopics-1,TotalPosts=TotalPosts-@netCount where ForumID=@ForumID

Delete From tblBBPosts Where TopicID = @TopicID
Delete From tblBBTopics Where TopicID =@TopicID

end
declare @pr_ForumsToday as varchar
declare @topicname as varchar

SELECT TOP 1 @topicname=Topics FROM tblBBTopics ORDER BY LastPostDate DESC
@pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
GO



i am getting error in the @pr_ForumsToday line
syntax error i think plz can any body help

TRY:

set @pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'

or

select @pr_ForumsToday= ' <p><A href=''bbviewposts.asp?id="'+ TopicID +'>' +left(@topicname,50) + ' ...</a>" & "</p>")'
Jul 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: marc | last post by:
I've been developing a stored procedure that uses a user defined function in the query portion of the procedure. However, since the end product needs to allow for dynamic table names, the UDF will...
8
by: Wonderinguy | last post by:
Hi everybody , I have been trying to execute a simple DB2 stored Procedure from perl. But it doesn't work. Could anybody please help me find out why this is happening : here is my perl script...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
2
by: Dave Anderson | last post by:
I really like Bob's "stored procedure as method of Connection Object" technique. It is convenient, compact, and concise, and simplifies protection from SQL injection. HOWEVER, I cannot figure...
1
by: gregoryday | last post by:
I am battling to get a stored procedure to build: I have a stored procedure working in SQL Server 2000, and now need to port it to DB2. I will be accessing the stored procedure via VB.NET. The...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
2
by: madhu7sudan | last post by:
HI here is the stored procedure CREATE Procedure dm_deleteBBPost ( @TopicID numeric, @ForumID numeric ) As declare @netCount as int
0
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...

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.