Questions tagged [procedure-definition]
16 questions
5
votes
4 answers
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 procedures which are "identical" except that one or other…
Robert Carnegie
- 740
- 5
- 11
2
votes
0 answers
Programmatically create a Role with Permissions within pgAdmin’s internal user management
I am asking about pgAdmin internal user management, not Postgres users-and-roles.
For teaching a beginning database class, I am trying to procedurally configure pgAdmin in Server Mode, using shell scripts, Podman, etc. In addition to the…
Basil Bourque
- 11,188
- 20
- 63
- 96
1
vote
2 answers
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.)
A T
- 391
- 3
- 9
- 19
1
vote
3 answers
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, @day, GETDATE()) which can use DAY/WEEK... as…
Ngoc
- 123
- 1
- 1
- 4
1
vote
1 answer
"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 TABLES, EXECUTE
But when I execute a sql file that…
4m1nh4j1
- 177
- 1
- 4
- 11
1
vote
1 answer
What is wrong with this a MySQL 5.6 procedure definition? Use a variable for table name
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 near 'NULL' at line 1
drop procedure if exists…
n370
- 121
- 6
1
vote
1 answer
SQL query to get the order of procedures based on their dependent procedures
i have this query to get all sp's and depending(nested) sp's on those sp's. I need to create all these procedures on another database . Any idea how to get them in the correct order.
select distinct procs.NAME AS ProcedureName ,OBJDEP.NAME as…
Viz Krishna
- 109
- 8
1
vote
1 answer
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
create or replace package hr.table_pkg
is
…
d0dulk0
- 11
- 2
1
vote
1 answer
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 ...) ?
kaissun
- 115
- 6
0
votes
1 answer
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 procedures from SQL-Server to Oracle Analytical…
bernd_k
- 12,369
- 24
- 79
- 111
0
votes
2 answers
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 Migration_procname from sysibm.sysprocedures where…
Nachiket Kate
- 101
- 1
- 4
0
votes
1 answer
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`,`avg_rating`)
SELECT `chef_id`,(SELECT count(chef_id)…
stefun
- 131
- 5
0
votes
1 answer
Unsafe_aggressive_sstable_expiration - Procedure to enable unsafe_aggressive_sstable_expiration
I am planning to enable this tag to solve an issue related to some SSTables that are fully expired and are blocking some other expired SSTables from being expired. I have looked for information on which procedure we should follow, but I cannot seem…
0
votes
0 answers
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…
ellie-lumen
- 271
- 1
- 7
- 14
0
votes
1 answer
Procedures In Oracle
--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 when ABC%notfound;
end…
TUFAIL KHAN
- 1
- 1