Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [procedure-definition]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
140 views

How can I write procedures that I can loop over to insert a series of files into my database?

My goal: Insert a series of csv files into my database by creating procedures for each individual table and then looping over them. My csv files will all be named very similar to this: ...
user avatar
0 votes
1 answer
306 views

Insufficient privileges as a definer of package

I cannot run a procedure within a package with a user that also defined it unless I specify "authid current_user" for some reason. Here is my original code that produces insufficient privileges error ...
user avatar
5 votes
4 answers
2k views

How do I compare large stored procedures?

I want to compare stored procedures that should be identical in several different databases, by retrieving and comparing the definitions from sys.sql_modules. Currently I'm thinking about ...
user avatar
0 votes
1 answer
28 views

Procedures In Oracle [closed]

--Procedures Exercise: create or replace procedure Display is cursor ABC is select empno, ename, sal from emp where deptno=10; emp_rec ABC%rowtype; Begin Open ABC; Loop fetch ABC into emp_rec; exit ...
user avatar
0 votes
2 answers
786 views

ORA-01422 Error Occurred When I Call Procedure with Number Parameter

I want to write PL/SQL Procedure that updates salary which is less than 2000. I wrote this procedure.And when i call it with integer id 'ORA-01422: exact fetch returns more than requested number of ...
user avatar
1 vote
3 answers
10k views

How to use DAY/WEEK/MONTH/YEAR constant as parameter in stored procedure?

Assume I have a table looks like this: Scores { Id uniqueidentifier, ScoredAt datetime, Value int } Basically I want to create a stored procedure that works similar to this DATEDIFF(DAY, ...
user avatar
  • 123
0 votes
2 answers
6k views

create a stored procedure if it doesnt exist using a ddl in db2

My requirements are, I want to create a ddl script which will check if a stored procedure exists on DB, if yes then drop it and recreate it. What I tried is, IF EXISTS (select procname into ...
user avatar
0 votes
1 answer
333 views

Error while creating procedure

This is my procedure: DELIMITER $$ CREATE PROCEDURE sp_test_final6() BEGIN INSERT INTO `chef_ratings`(`chef_id`,`avg_total_no_votes`,`avg_total_rating`,`no_of_votes`,`...
user avatar
  • 131
1 vote
1 answer
8k views

"Access denied for user" error when creating a procedure

When I request my database server (MySQL), with "show grants for current_user" I notice that I have the grant to execute procedure: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK ...
user avatar
  • 157
1 vote
1 answer
2k views

What is wrong with this a MySQL 5.6 procedure definition? Use a variable for table name [closed]

Just can't understand why it's throwing this error? Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ...
user avatar
  • 121
1 vote
1 answer
631 views

Oracle, Stored and External procedures

Could someone give me a brief explication about these two mechanisms in oracle : stored and external procedures. Are they distinct ? Are they differ when we integrate in some language (Java, C++ or C ...
user avatar
  • 115
1 vote
2 answers
495 views

ORM-style server-side programming languages (OO replacement for PL/SQL?)

Good evening, Is there an Object Oriented replacement for PL/SQL, allowing server side procedures to be written [and then called client or server side]? (for MySQL, PostgreSQL, Oracle or etc.)
user avatar
  • 391
0 votes
1 answer
255 views

How to find "outer join in the where" syntax in SQL 2005 using cmptlevel 80?

Well last Christmas I was very happy, because we ceased support for SQL Server 2000. I could stop twisting my brain and use friendly analytical functions. (Believe me, when it comes to migrate stored ...
user avatar
  • 11.8k