stored-procedures

.NET Oracle Provider: Why will my stored proc not work?

I am using the Oracle .NET Provider and am calling a stored procedure in a package. The message I get back is "Wrong number or types in call". I have ensured that the order in which the parameters are being added are in the correct order and I have gone over the OracleDbType's thoroughly though I suspect that is where my problem is. Here...

Oracle Stored Procedure with Alter command

I am trying to build an Oracle stored procedure which will accept a table name as a parameter. The procedure will then rebuild all indexes on the table. My problem is I get an error while using the ALTER command from a stored procedure, as if PLSQL does not allow that command. ...

Creating a User Defined function in Stored Procedure in SQL 2005

Hello, I have a stored procedure in which i want to create a user defined function - Split (splits a string separated with delimiters and returns the strings in a table), make use of the function and finally drop the function. My question is that whether i can create a user defined function inside a stored procedure and drop it finally...

Check if a string contains a substring in SQL Server 2005 Stored Procedure

Hello I've a string @mainString = 'CATCH ME IF YOU CAN'. I want to check whether the word 'ME' inside @mainString. So how to check if a string has a substring in sql? Thank you Regards NLV ...

How to send a Timestamp field to Oracle stored proc. from Java despite the DB config?

I'm making a request from a java webapp to an Oracle' stored procedure which happens to have a Timestamp IN parameter. The way info travels is something like: javaWebApp --} webservice client --} ws --} storedProcedure And I send the Timestamp param as a formatted string from the webservice client to the ws. In the testing environmen...

nested insert exec work around

I have 2 stored procedures usp_SP1 and usp_SP2. Both of them make use of insert into #tt exec sp_somesp. I wanted to create a 3rd stored procedure which will decide which stored proc to call. Something like: create proc usp_Decision ( @value int ) as begin if (@value = 1) exec usp_SP1 -- this proc already has insert into #tt...

XML Return from an Oracle Stored Procedure

Unfortunately most of my DB experience has been with MSSQL which tends to hold your hand a lot more than Oracle. What I'm trying to do is fairly trivial in tSQL, however, pl/sql is giving me a headache. I have the following procedure: CREATE OR REPLACE PROCEDURE USPX_GetUserbyID (USERID USERS.USERID%TYPE, USERRECORD OUT XMLTYPE) AS...

Getting sourcecontrol on stored procedures

First off the technical stuff: We're using VS 2008 pro and running a MS SQL 2008 server. For sourcecontrol we use Subversion. We'd really like to keep our stored procedures in subversion, so we can tell what was changed, when and so forth. However in order for this to work, it has to be seamless, otherwise the developers are just goin...

Value Comparison with a multivalued column in SQL Database Table

Hi All, Suppose there is a table A which has a column AccessRights which is multivalued( Eg of values in it in this format STOLI,HELP,BRANCH(comma separated string) Now a stored procedure is written against this table to fetch records based on a AccessRight parameter sent to the SP. Let that parameter be @AccessRights, this is also a c...

switch between two cursors based on parameter passed into stored procedure

Hi, I have two cursors in my procedure that only differ on the table name that they join to. The cursor that is used is determined by a parameter passed into the procedure if (param = 'A') then DECLARE CURSOR myCursor IS SELECT x,y,z FROM table1 a, table2 b BEGIN FOR aRecord in myCursor LOOP p...

Can I call a stored procedure with hibernate criteria?

This is my problem, I have to use a big SP, and there is no time to rewrite in java. So I'm using Hibernate criteria and I don't know if i can call it. Thanks to all. ...

Changinge case of tablenames inside stored procedure of mysql...

hi guys... I am here to change the uppercase table name present in the stored procedures. I have got nearly 100 stored procedures. is there any shortcut way so that i can change all the uppercase table names to lowercase within short time... ...

Using Stored Procedure into Select (T-SQL)

Hi, I need to access result of a stored procedure withinf a select statement (ie : SELECT * FROM [dbo].[sp_sample]) in SQL_Server 2005. Regards, Stéphane ...

How to handle Oracle Stored Proc with ASP.NET and Oracle Data Provider?

I have been struggling with this for quite some time having been accustomed to SQL Server. I have the following code and I have verified that the OracleDbType's are correct and have verified that the actual values being passed to the parameters match. I think my problem may rest with the return value. All it does is give me the row count...

sp_xml_preparedocument

How to process xml string into store procedure? any help? I don't find sp_xml_preparedocument procedure in sql server 2008... Any input? ...

Cryastl Reports is not recognizing that a new parameter has been added to the report's stored proc

i have added another input parameter to a stored proc used by a crystal report. i've had our dba recompile the stp to be sure that the new parameter is cached and "really there". i cannot get my crystal report to recognize the new parameter -- i've tried verifying database and using the Set Datasource Location/Update to re-select the s...

Perl DBI execute not maintaining MySQL stored procedure results

I'm having a problem with executing a stored procedure from Perl (using the DBI Module). If I execute a simple SELECT * FROM table there are no problems. The SQL code is: DROP FUNCTION IF EXISTS update_current_stock_price; DELIMITER | CREATE FUNCTION update_current_stock_price (symbolIN VARCHAR(20), nameIN VARCHAR(150), currentP...

Stored Procedure with ALTER TABLE

I have a need to sync auto_increment fields between two tables in different databases on the same MySQL server. The hope was to create a stored procedure where the permissions of the admin would let the web user run ALTER TABLE [db1].[table] AUTO_INCREMENT = [num]; without giving it permissions (That just smells of SQL injection). My pr...

Execute sybase stored proc from hibernate

I am having issues with executing a simple sybase stored proc from hibernate. The procedure takes some input and returns one record. I tried with the following tag in hibernate mappings file and java code. <hibernate-mapping> <sql-query name="sybaseproc" callable="true"> <return class="Myentity"> <return-property name="next" colu...

Retrieving a filtered list of stored procedures using t-sql

I'm trying to get a list of stored procedures in t-sql. I am using the line: exec sys.sp_stored_procedures; I would like to filter the results back though, so I only get user created stored procedures. I would like to filter out sp_*, dt_*, fn_*, xp_* and everything else that is a system stored procedure and no interest to me. How ...