CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Stored procedures

Print topic Send  topic

Author Message
DENSMA
Posted: 03/21/2004, 6:22 PM

im new to stored procedures, i manually created sp to update, insert and delete
but insert and update doesn't seem to work when entrying or updating date from webform. i get blank insert

here wht insert sp look like.. this a sample app (guestbook)

CREATE Procedure [spIns_guestbook]
(
@id [int] = Null Output -- for [guestbook].[id] (auto increment)
, @Name [char](30) = Null -- for [guestbook].[Name] column
, @email [char](30) = Null -- for [guestbook].[email] column
, @Sex [char](10) = Null -- for [guestbook].[Sex] column
, @website [char](30) = Null -- for [guestbook].[website] column
, @Location [char](30) = Null -- for [guestbook].[Location] column
, @Reason [char](10) = Null -- for [guestbook].[Reason] column
, @Comment [nvarchar](200) = Null -- for [guestbook].[Comment] column
)

As

Set NoCount On

If @id Is Null
Begin

Insert Into [dbo].[guestbook]
(
[Name]
, [email]
, [Sex]
, [website]
, [Location]
, [Reason]
, [Comment]
)

Values
(
@Name
, @email
, @Sex
, @website
, @Location
, @Reason
, @Comment
)

Set @id = Cast(SCOPE_IDENTITY() As [int])

End

Else
Begin
Set Identity_Insert [dbo].[guestbook] On

Insert Into [dbo].[guestbook]
(
[id]
, [Name]
, [email]
, [Sex]
, [website]
, [Location]
, [Reason]
, [Comment]
)

Values
(
@id
, @Name
, @email
, @Sex
, @website
, @Location
, @Reason
, @Comment
)

Set Identity_Insert [dbo].[guestbook] Off

End

Set NoCount Off

Return(0)

GO
Jaro Steigauf
Posted: 03/22/2004, 10:43 PM

Hi,

I send you link very usefull - http://www.mygenerationsoftware.com/
- it generates stored proc. from databases MSQL, mySql, etc.
- it is free software


jaro


"DENSMA" <DENSMA@forum.codecharge> wrote in message
news:8405e4dffd2d80@news.codecharge.com...
> im new to stored procedures, i manually created sp to update, insert and
delete
> but insert and update doesn't seem to work when entrying or updating date
from webform. i get blank insert
>
> here wht insert sp look like.. this a sample app (guestbook)
>
> CREATE Procedure [spIns_guestbook]
> (
> @id [int] = Null Output -- for [guestbook].[id] (auto increment)
> , @Name [char](30) = Null -- for [guestbook].[Name] column
> , @email [char](30) = Null -- for [guestbook].[email] column
> , @ [char](10) = Null -- for [guestbook].[] column
> , @website [char](30) = Null -- for [guestbook].[website] column
> , @Location [char](30) = Null -- for [guestbook].[Location] column
> , @Reason [char](10) = Null -- for [guestbook].[Reason] column
> , @Comment [nvarchar](200) = Null -- for [guestbook].[Comment] column
> )
>
> As
>
> Set NoCount On
>
> If @id Is Null
> Begin
>
> Insert Into [dbo].[guestbook]
> (
> [Name]
> , [email]
> , []
> , [website]
> , [Location]
> , [Reason]
> , [Comment]
> )
>
> Values
> (
> @Name
> , @email
> , @
> , @website
> , @Location
> , @Reason
> , @Comment
> )
>
> Set @id = Cast(SCOPE_IDENTITY() As [int])
>
> End
>
> Else
> Begin
> Set Identity_Insert [dbo].[guestbook] On
>
> Insert Into [dbo].[guestbook]
> (
> [id]
> , [Name]
> , [email]
> , []
> , [website]
> , [Location]
> , [Reason]
> , [Comment]
> )
>
> Values
> (
> @id
> , @Name
> , @email
> , @
> , @website
> , @Location
> , @Reason
> , @Comment
> )
>
> Set Identity_Insert [dbo].[guestbook] Off
>
> End
>
> Set NoCount Off
>
> Return(0)
>
> GO
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


---
Odchadzajuca sprava neobsahuje virusy.
Skontrolované antivírusovým systémom AVG (http://www.grisoft.cz).
Verzia: 6.0.627 / Vírusová databáza: 402 - dátum vydania: 16. 3. 2004


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.