Top "Stored-procedures" questions

A subroutine available to applications accessing a relational database system.

How to convert int to char with leading zeros?

I need to convert int datafield to nvarchar with leading zeros example: 1 convert to '001' 867 convert to '000867', …

sql-server stored-procedures
SQL Call Stored Procedure for each Row without using a cursor

How can one call a stored procedure for each row in a table, where the columns of a row are …

sql sql-server stored-procedures cursor
How to test an Oracle Stored Procedure with RefCursor return type?

I'm looking for a good explanation on how to test an Oracle stored procedure in SQL Developer or Embarcardero Rapid …

oracle stored-procedures plsqldeveloper ref-cursor rapidsql
Using a cursor with dynamic SQL in a stored procedure

I have a dynamic SQL statement I've created in a stored procedure. I need to iterate over the results using …

tsql stored-procedures dynamic-sql database-cursor
Passing an array of data as an input parameter to an Oracle procedure

I'm trying to pass an array of (varchar) data into an Oracle procedure. The Oracle procedure would be either called …

oracle stored-procedures plsql
SQL Server: Query fast, but slow from procedure

A query runs fast: DECLARE @SessionGUID uniqueidentifier SET @SessionGUID = 'BCBA333C-B6A1-4155-9833-C495F22EA908' SELECT * FROM …

sql-server performance stored-procedures
How to detect if a stored procedure already exists

I have to write a deployment script which will work if a stored procedure exists or does not exist. i.…

sql sql-server-2005 stored-procedures
Postgres FOR LOOP

I am trying to get 25 random samples of 15,000 IDs from a table. Instead of manually pressing run every time, I'm …

postgresql stored-procedures for-loop random plpgsql
The maximum recursion 100 has been exhausted before statement completion

I keep getting a max recursion error with this query. At first I thought it was because a null was …

sql stored-procedures common-table-expression
What is the difference between a stored procedure and a view?

I am confused about a few points: What is the difference between a stored procedure and a view? When should …

sql sql-server-2005 stored-procedures views