CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Stored Procedure in CCS

Print topic Send  topic

Author Message
mpsilva

Posts: 1
Posted: 07/21/2010, 2:52 AM

Hello,

I have a procedure created in SQL 2005 and that works fine in SQL but I am having trouble using it in the CCS.

I use the procedure to select a table fields tblFactura to then insert the table tblHistorico. The next step would be to update the table fields tblFactura. When I set to custom update
Custom Insert Type: Procedure and Custom Inser: ActualizaHistorico, the procedure only updates the table tblFactura but does not update the table tblHistorico. If I set the Customs update the procedure does not work

Can I call the procedure in the event "After update"? How should I call the procedure in the event "After update"?

This is the Stored Procedure

USE [DBFactura]
GO
/****** Object: StoredProcedure [dbo].[ActualizaHistorico] Script Date: 07/21/2010 10:28:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[ActualizaHistorico]
-- Add the parameters for the stored procedure here



@Empresa int,
@NumeroFactura varchar(50),
@Valor money,
@EstadoMercadoria int,
@DataFactura datetime,
@OrdemCompra int,
@Observacao varchar(Max),
@facturaId int,
@EstadoFactura int,
@userid int


AS
BEGIN

INSERT INTO dbo.tblHistorico

SELECT userid, DataReceocaoDTI, EstadoFactura, idFactura,Observacao
FROM dbo.tblFactura
WHERE idFactura=@Facturaid

UPDATE dbo.tblFactura
SET
Empresa=@Empresa,
NumeroFactura=@NumeroFactura,
DataReceocaoDTI=GETDATE(),
EstadoFactura=@EstadoFactura,
Observacao=@Observacao,
Valor=@Valor,
EstadoMercadoria=@EstadoMercadoria,
DataFactura=@DataFactura,
OrdemCompra=@OrdemCompra,
userid=@userid



WHERE idfactura=@facturaId

END

Regard's
View profile  Send private message
RoyHobbs99223


Posts: 37
Posted: 10/30/2012, 9:43 AM

Did you ever get an answer on how to call a stored procedure from CCS?
View profile  Send private message
Vasiliy

Posts: 378
Posted: 10/30/2012, 7:31 PM

Call ExecuteNonquery right from CCS After Update, if errors.count = 0.

Btw, why SP with bunch of params if your code can be executed from CCS directly?


_________________
Vasiliy
View profile  Send private message

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.