Callable code installed on a database manager, exposing an API through which it can be invoked. Normally written in the native query language, some DBMS platforms support other languages as well.

learn more… | top users | synonyms

1
vote
0answers
11 views

creating deadlock for distributed database in mysql-(Testing purpose)

I need to create a deadlock for distributed database in MySQL for testing purpose with a simple sql query(without front end), can anyone good with MySQL query help me out in this with sample query. ...
4
votes
1answer
27 views

MySQL overhead of calling a Stored Procedure

Within Java, we access MySQL (v5.5.40) via JDBC -- a prepare statement, setting parameters then calling the stored procedure. It appears that every execute() has the overhead of 4 meta-calls (per ...
0
votes
0answers
6 views

MySQL log shows excessive meta queries on SP calls [duplicate]

We access MySQL via JDBC -- a prepare statement, parameters binding then invoking the actual stored procedure. It appears that every execute() has an associated "overhead" of 4 meta-calls (per MySQL ...
2
votes
0answers
16 views

MS SQL Parsing with XPath Performance

I have a UI that allows a user to select certain data points they want to filter the results by. There are things such as location, department etc. Once they have selected all of the options, I ...
0
votes
1answer
17 views

How can I limit a user to only be able to run procs in a schema, which access another db?

In a SQL Server 2012 SP2 Standard Edition instance I have a user in database A that needs to be able to run stored procedures in schema foo within that database. They shouldn't be able to do anything ...
0
votes
2answers
67 views

Sql Agent Jobs executes too slow

I have posted a question like this before but is seems that I did not explain the whole story clear. So I made this one to explain it in details. Here's the stored procedure USE [xxxx] GO /****** ...
0
votes
1answer
20 views

ORA-01722 Error when running stored procedure

I am trying to run a stored procedure however when I run it with an a valid Number it gives me an ORA-01722 error. I checked to make sure that the columns in the where clause where the parameter is ...
-4
votes
0answers
19 views

Update using SQL Stored Procedure [closed]

I am new to SQL, I have 3 tables and I want to perform following logic via a stored procedure. IF Table A.Item No = MasterTable. Iteam No Then, Add a Record in table Short Expiry where Unique ID = ...
1
vote
2answers
59 views

How to update a multiple rows all at once with a procedure.?

Im trying to do a procedure to update an (for now) empty column recently added. In this new column, i will put the values of the result obtained by a join query. To explain it better, i have this ...
-1
votes
0answers
26 views

Stored procedure [closed]

I want to write a stored procedure that will insert data into two tables in SQL Server 2008 R2 but I am getting error. create table custlogin1 ( custid int primary key identity(1,1) not null, ...
2
votes
1answer
24 views

MySQL stored procedure user privilege

I have a query regarding user permission on a stored procedure. If a user that does not have permissions to create tables in a database, but it does have permissions to create and execute stored ...
0
votes
0answers
52 views

How can I replace the cursor in the below query?

I have this below query which calls a stored procedure that takes only 1 item's attributes at a time. But because of performance problems we are required to remove the cursor. How can I replace the ...
2
votes
1answer
34 views

stored procedures vs inline SQL in a Job step SQL SERVER 2014

I have created a job with two steps. Step 1 deletes 50000 rows from an error table older than 90 days. Step 2 creates and emails a quick report on the number of new records created in the error ...
0
votes
0answers
23 views

IF statement inside stored procedure, seems to cause locks by side effects

We are running a MySQL 5.5. server with READ-COMMITTED transaction level to store and process a large time series dataset. We have a large time-series-table, into which we write batch updates every ...
0
votes
0answers
23 views

Hide Inconsequential Result Sets From Stored Proc

How does one mask resultsets in multi-layered stored proc calls? Due to stored proc reuse, I have an issue where a top level stored procedure calls multiple stored procedures (directly) and in-tern ...
0
votes
1answer
59 views

SQL Server : execute stored procedure from another stored procedure

I have two stored procedures. Proc1 executes a SQL statement and results a data table as a result set. I need to use the datatable in a select SQL that resides in proc2 as a datasource. like, ...
2
votes
1answer
124 views

Stored Procedure with Table Value Parameter

I'm attempting to write a stored procedure that will have two parameters. ComputerName | nvarchar Monitor_Serial | Table-valued parameter (TVP) I'm using a TVP because some computers have an ...
0
votes
1answer
29 views

Call a stored procedure for every select result

I have an stored procedure to delete from a long series of tables. It uses one main ID as parameter. I have to delete a bunch of rows based on a view that show that lot of tables. I want to apply the ...
0
votes
2answers
70 views

Executing sp in ssms much faster than executing in job step

My stored procedure takes 23 secs in ssms but takes 4 minutes when exec via job. Can you please help me in finding out. Below is SP code ALTER procedure [ops].[trailers_sitting_builder_mod] --WITH ...
0
votes
1answer
31 views

SQL Server stored procedure to insert/ update which has date

The source which has date in dd-MMM-yy format , have to convert it yyyy-mm-dd hh:mm:ss:SS and insert/update into the Database using stored procedure.New to stored procedure I am managed to write a ...
0
votes
2answers
19 views

Logging the Execution times of dynamically constructed mysql stored procedures

I have a MySQL Server. The MySQL server contains a huge network data collection. The client API's will connect to the MySQL server and execute some dynamically created stored procedures and delete ...
2
votes
1answer
79 views

How to output more than 4000 characters in sqlcmd

I've made a stored procedure restoredatabase that returns code to restore a database. The output script looks like this: restore database [DB] from disk='F:\FULL1.bak' with norecovery restore ...
6
votes
2answers
294 views

Unexpected Implicit conversion in a procedure

I have a procedure like this (simplified): CREATE PROCEDURE test @userName VARCHAR(64) SELECT * FROM member M INNER JOIN order O ON M.MemberId=O.MemberId WHERE M.Username = @userName There is a ...
0
votes
1answer
40 views

“Incorrect Syntax near S” in Stored Procedure [closed]

I'm creating a SQL Server stored procedure and getting error Incorrect Syntax near S I'm not able to find the exact reason of the error. CREATE PROCEDURE RPT_IVR_CALL_SUMMARY ...
0
votes
0answers
19 views

Procedure or function 'sp_InsertImages' expects parameter '@Img_path', which was not supplied [migrated]

i have passed img_path in my code nd procedure but it show me error please anyone help me. my procedure is : create proc sp_InsertImages ( @Img_path nvarchar(max), @product_id numeric(18,0), ...
0
votes
0answers
50 views

Optimising an SP - Left Join against several big tables

I have stumbled upon performance bottleneck due to LEFT JOIN against several big tables (approx. 6 million rows of data, consisting of 10 columns). Any suggestions on how to optimize this SP is ...
0
votes
2answers
42 views

Executing stored procedures asynchronously using tasks in SSIS

I have a stored procedure which is calling 20-30 stored procedures. I need these stored procedures to run asynchronously. From what I have read, it seems like executing those stored procedures using ...
0
votes
0answers
30 views

Mysql cursor alternative / Optimization - each row updates are too slow

I'm looking to optimize my cursor based update or actually replacing it... Situation We're carrying out promotional campaigns and I'd like to track user activity per campaign. Logic Each campaign ...
0
votes
1answer
23 views

Access denied to user@localhost

As a root user i did this: GRANT DELETE, SELECT, INSERT, UPDATE, EXECUTE ON dbName.* TO 'user'@'localhost' IDENTIFIED BY 'apassword'; In 'dbName' i created a procedure 'proc_name' with definer set to ...
0
votes
0answers
39 views

MySQL is pretty slow after 50-100k rows whats happen?

i have trying now a lots of time, and i try to find a way there make sense to find out of my problem, but this problem stil make a lot perfumes issues. i testing it of on a developer server ( 2 ...
3
votes
2answers
36 views

Getting Machine name from where stored procedure was last executed

Is there any way to find out machine IP or machine name from where a particular stored procedure is executed in SQL Server 2005? We have a client server architecture with .NET as a front end and SQL ...
0
votes
0answers
31 views

Can I change “Category_Id” & “Current_execution_status” value in SQL Server 2012 through stored procedure?

I have created one job in SQL Server 2012 through SQL Server agent, and that job is not running due to some security privileges. When I am seeing through below SQL query to that my created job ...
0
votes
2answers
45 views

How to Solve ERROR 1064 (42000)?

DROP PROCEDURE IF EXISTS proc_x; DELIMITER # CREATE DEFINER=`root`@`localhost` PROCEDURE proc_x(sequel CHAR) proc_main:BEGIN SET @SQL = CONCAT(@sequel); PREPARE stmt FROM @SQL; EXECUTE stmt; ...
0
votes
1answer
41 views

Need help with my MySQL PROCEDURE #1193 - Unknown system variable

I've this simple table: CREATE TABLE IF NOT EXISTS `testing` ( `testing_ID` INT UNSIGNED NOT NULL AUTO_INCREMENT, `meter` INT NOT NULL, `price` DECIMAL(12,2) NOT NULL, ...
0
votes
1answer
24 views

“show procedure status” displaying the non existing databases stored procedures in mysql server

i have taken a mysql server backup using mysqldump and imported the backup file in another mysql server.Import failed because of disk full issue. Only 11 databases are created out of 15 . when i issue ...
0
votes
1answer
26 views

No records in Mysql.func table even though there are stored functions in server

When i am creating a user defined function in one of my mysql server, it's not creating any row in mysql.func table . Even though i have multiple functions in my mysql server , this table is empty . ...
1
vote
2answers
89 views

MySQL Workbench not showing stored procedures that I have created

I have a simple stored procedure that I have just created. I have applied this script to my database This script shows up in the my list of stored procedure However, when I restart MySQL ...
0
votes
0answers
22 views

MySQL: routines removed but still in information_schema

I have a MySQL server with a lot of stored procedures (around 150). When I tried to list the routines with PHPMyAdmin it requires a lot (around 2-3 minutes) in order to load all of them. So I started ...
2
votes
2answers
182 views

Insert/Update Stored Procedure

My database model is quite simple. I have the following tables: Monitor, Computer, and Monitor_Computer_Map as my mapping table for a many-to-many relationship between the other two tables. I have a ...
1
vote
0answers
28 views

Clarification on usage of Serially Reusable Pragma for Oracle 10g

I need to make packages for Oracle 10g that can be changed while users are still logged in an using an application that makes database calls through PL/SQL. Unfortunately, anytime a package is updated ...
0
votes
1answer
21 views

Is there any way to perform atomic updates of stored procedures in MySQL?

I know that MySQL does not support atomic updates of stored procedures yet and it is bug which was reported on 2005 but not yet resolved.(http://bugs.mysql.com/bug.php?id=9588). In our project ...
5
votes
4answers
201 views

How to check if Alter view/stored proc script has run successfully

For the database deployments, I call all the db schema changes in a batch file and run them on the target database. Sometimes we have scripts for altering the views or stored procs. I'm wondering ...
1
vote
2answers
74 views

Stored procedure to check if username exists

I'm trying to write a stored procedure So far I have this, but it always returns 1 CREATE DEFINER=`root`@`localhost` PROCEDURE `USER_EXISTS`(IN `USERNAME` VARCHAR(64) CHARSET utf8mb4) SELECT CASE ...
0
votes
0answers
22 views

Report not pulling records

Stored procedure working fine. Procedure contains 5 parameters and 30 columns. I am using this stored procedure in my SSRS report. When I click preview, it is asking for parameter values I just ...
0
votes
0answers
14 views

When will store procedure/functions support result set as return type

I have noticed that MySql doesn't support result-set on a store procedure and functions, which means return a table. So I can't do things like CALL sp_my_store_procedure() ORDER BY id ASC; Or ...
1
vote
2answers
111 views

Stored procedure big where clause or multiple procedures

Is it better to have one big query or N small ones? For example to select all the customers with multiple parameters: select id, name, firstname, city, birthday, ... from ...
0
votes
1answer
30 views

Function to handles firstname and lastname to a specific format

I'm trying to figuring out a way to show a name properly. Let's say I have 2 variable : @Firstname = 'Marc-Oliver' @Lastname = 'Saint-Onge' I would like to have name shown as; M.-O. St.Onge Or ...
1
vote
3answers
835 views

How to create a SQL trigger to execute a stored procedure when a table is updated

i need some help with creating a trigger to run a qf.stored_procedure when a qf.table is created. AT the moment, i have a job t run the stored procedure every 15 minutes but changing that is not an ...
0
votes
1answer
86 views

How to create a stored procedure with columns from three different tables in SQL Server 2008?

I'm a fresher and I would like to get some suggestions on how to create a stored procedure in which I have to select columns from three different tables. 2 columns customername and customercode from ...
0
votes
1answer
63 views

Update MySQL Stored Procedure Definers on shared environment

I am accessing a MYSQL database through PHPMyADMIN. My issue is that throughout the course of a project, my Stored Procedures were created through two main places. PHPMyAdmin, and through MySQL ...