stored-procedures

How to Execute stored procedure from SQL Plus?

I have a stored procedure in oracle and want to test it from SQLPlus. If I use execute my_stored_proc (-1,2,0.01) I get this error PLS-00306: wrong number or types of arguments in call to my_stored_proc The beginning for the proc is this create or replace PROCEDURE my_stored_proc ( a IN NUMBER, b IN NUMBER, c IN NUMBER, ...

SQL [Conversion to bool]

C++Builder ADOQuery SQLServer I'm using a stored procedure with this select SELECT Name, COALESCE( ( SELECT TOP 1 0 FROM TbUserParam WHERE TbUserParam.ID_User = @ID_User AND TbUserParam.ID_Param = CfgListParIzm.ID_ListParIzm ), 1) Visi FROM CfgListParIzm WHERE ...

C# ExecuteQuery null value

I have some code: using (OAZISDBDataContext ctx = new OAZISDBDataContext()) { IEnumerable<DBContactDetail> details = ctx.ExecuteQuery<DBContactDetail>("exec [dbo].[zna_contact] {0}, {1}", "test", "19601023", } However I also want to be able to pass empty ...

Is it possible to save and reuse a set of Parameters as a code block in SQL Server Express 2005?

I have several stored procedures that all use the same set of parameters. Is there a way to define and save the parameter list as a reusable block of code? Something like this: CREATE PROCEDURE test Using StoredParameterList AS BEGIN SQL Statement END Is this possible? It would make code maintenance easier if a parameter n...

DB2 - How to call a stored procedure in IBM System i Access for Windows GUI Tool

I would like to test a DB2 stored procedure running on an AS400 system. I have the IBM System i Access for Windows installed and can run SQL commands against the DB2 database. My question is: What is the syntax to execute a stored procedure that takes in a parameter and returns a result as an output parameter and print the value to the...

SQL to Linq equivalent

I've got this stored procedure I'd like to convert to LINQ to SQL, but I'm having a bit of trouble because I'm new to LINQ (and actually, I'm no SQL guru) and I am not getting the expected results. (I tried calling the SPROC from LINQ to SQL but when I send in the Period datetime as parameter on the SPROC I get some error on L2S about th...

Is it.. Good / Bad / Okay ... to use IF/While Conditions in Stored Procedures ?

My primary concern is with SQL Server 2005... I went through many website and each tells something different. What are the scenarios that are good / ok to use.. For example does it hurts to even set variable values inside IF or only if I run a query. Supposing my SPs is building a dynamic SQL based of several conditions in Input Param...

Mixed Table Type with other types as parameters to Stored Procedured c#

Hi, I am asking about how could i pass multi parameters to a stored procedure, one of these parameters is user defined table. When I tried to do it it shows this error: INSERT INTO BD (ID, VALUE, BID) values( (SELECT t1.ID, t1.Value FROM @Table AS t1),someintvalue) here @Table is the user defined table parameter. Msg 116, Level 1...

Null value being returned from a Stored Procedure using Linq to SQL

If I run a stored procedure in my database (SQL 2000) and return the SCOPE_IDENTITY, I receive a value. However, using LINQ to SQL, I get a null value for the Column1 property. Anyone have a suggestion? ...

how can I use store procedure in subsonic 3.0.3 ?

I have a problem in subsonic 3.0.3. When i use subsonic to genarate code , i can use all table in database But i can't see any store procedure which had been defined in database. Please help me. P.S. : I am using MSSQL ...

Problem in stored procedure result

I have a store procedure like this : ALTER PROCEDURE [dbo].[CheckUser&Pass] ( @Username nchar(15), @Password nchar(15) ) AS SET NOCOUNT ON; SELECT Username, Pass, Code_Person FROM Login WHERE (Username = @Username) AND (Pass = @Password) And Execution : DECLARE @return_value int EXEC @return_...

The result of stored procedure to a table, without creating the table manually in SQL Server

What I need to do is, put the results of stored procedure (with lots of parameters) in to a table. Something like that: SELECT * INTO Table_1 FROM ( EXEC [MY_DataBase].[dbo].[GET_Report] '%%', '%%', '%%', 'x', 'x', 'x', 'x', 'x', 'x' .... ) X However this seems to be an incorrect syntax, I searched for it and people are first creatin...

Informix: The meaning of dot (.)?

Hey guys, I am wondering if anyone could tell me any special meaning of the dot (.) in Informix regarding expressions and etc. For example in stored procedures I see it used with integers, decimals and chars and one thing that is bugging me quite a lot is this: if value = '.' then //do something end if The above expression validate...

Display all the stored procedures in a database

Is there any way to display all of the stored procedures in a database? ...

Stored Procedures in Python for PostgreSQL

Hello, we are still pretty new to Postgres and came from Microsoft Sql Server. We are wanting to write some stored procedures now. Well, after struggling to get something more complicated than a hello world to work in pl/pgsql, we decided it's better if we are going to learn a new language we might as well learn Python because we got th...

Reporting Stored Procedure - How to avoid duplication?

I'm writing a reporting stored procedure. I want to get the number of non-Acknowledged and non-Invoiced Purchase Orders, with the ability to (optionally) filter on CustomerID. What I have below works as expected, but I worry that a) it's slow and b) there's duplication in the CustomerID portion of the WHERE clause. How would you write...

Conversion failed when converting the nvarchar value to int

hi friends, Declare @count nvarchar(max) set @count ='select COUNT(*) from '+ @tablename+'' if( @count =0 ) begin print 'fail' end else begin print 'success' end end the @count variable is not getting the value 0. it shows the error as Conversion failed when converting the nvarchar value 'select COUNT(*) from tablename' to dat...

how to get data through a stored procedure in wcf??

Hi, I am working on a wcf application where i want to access some columns from a table (prefebly via stored procedure) through wcf and pass it to client. I have searched a lot on the google but unable to find a good example of it. Can some one help me please. Thanks in advance ...

Stored procedures vs JDO for data warehousing project

Hi there, In the old days we used to access the database through stored procedures. They were seen as `the better' way of managing the data. We keep the data in the database, and any language/platform can access it through JDBC/ODBC/etc. However, in recent years run-time reflection/meta-data based storage retrieval mechanisms such as...

SQL proc Diagram generating Software of a Programm Flow.

I have a couple of very long procs in Oracle 2000+ lines with lots of calls. And I'd like to generate programm flow Diagram (algorithm) for better understanding of the process for further Refactoring. It's not the code I wrote so I dont know the logic enough. What would you advice to do in this case? I tried to draw a text-like flow bu...