Questions tagged [Stored procedures] (36)

1
answer

How to write data in two table from one procedure?

Good afternoon. There is a procedure that returns two different resultscreate proc Myproc as select top 10 * from clients select top 10 * from Firms Somehow I can record both streams in a pre-prepared temporary tables or I can only do it inside the procedure?
Davi asked March 19th 20 at 19:10
2
answers

How to forbid to pass a null argument to a procedure?

As when you create a pl/sql procedure to prohibit to pass in the argument NULL, to make them strictly (for example) VARCHAR2? While explicit checks in the style of "IF arg IS NULL THEN ..." should be avoided, because it is transmitted a lot of arguments and their litters individual verification code. There is some kind of m...
Frieda asked March 17th 20 at 08:57
2
answers

Question on MySQL, correctly engine=memory to do the insert?

To optimize the import of goods in the online store, I want the updated data warehouse to enter into a temporary table in memory, and then read from it, updated data and record them in the table online store. Everywhere, just everywhere write about the fact that create temporary tables, including memory need immediately wit...
cade_Effer asked March 13th 20 at 14:46
1
answer

How to optimize a stored procedure?

When updating the online store, a temporary table is created, after inputting data which runs a stored procedure:DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `sync_fl`() BEGIN DROP TABLE IF EXISTS `sh_prod_im__`; ALTER TABLE `sh_prod_im` RENAME TO `sh_prod_im__`; ALTER TABLE `sh_prod_im_` RENAME TO `sh_prod_im`; END$...
Jessyca.Robel97 asked March 13th 20 at 14:29
2
answers

How to write stored procedure in MySQL with a block IF/THEN/ELSE inside? (IntelliJ IDEA users here too)?

Fully the question is: How to write stored procedure in MySQL in which there is a block IF THEN ELSE, what would this script then can be run from different environments without syntax errors? I will explain... The SQL script can be done in different ways: from the command line;special GUI tools like MySQL Administrator or M...
jamey_Purdy asked October 10th 19 at 12:22
10
answers

HELP: How to work with large amounts of data? Oracle or Mysql?

There is a mysql database, it is innodb table of 120 million rows and all eeedddiiieee works. Wrote a procedure, the cursor iterates through the data portion (1 million) from a large table, for each record making 10 simple queries by using the index keys in the same table if the condition passes, then an entry is inserted ...
hugh_Kun asked October 10th 19 at 02:45
1
answer

Stored procedure, name the parameters?

As far as I know in MySQL there is no possibility to do so: call stored_procedure(param2 = val2, param1 = val1) At the same time in C# (using MySQL.Data) I can set the parameters like this: Command.Parameters.AddWithValue(parameterName, parameterValue) Is it possible in PHP?
wanda90 asked October 3rd 19 at 17:59
1
answer

Using parameters of the execute method in stored procedures?

A question for those who worked with stored procedures Vkontakte. There is a stored procedure seeking groups with audio recordings:var q; var groups = API.groups.search({"q": q}); if (groups.length == 0) { return {}; } var i = 1; var res = []; while (i < groups.length - 1){ i = i + 1; var grp = groups[i]; var songs ...
annalise_Jaskolski asked October 3rd 19 at 12:58
1
answer

Assignment of user rights dynamic query?

Create a dynamic query in a stored procedure to create the user. The creation of user is fine but when you try to give it rights gets error: 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 'GRANT USAGE ON *.* TO 'malan1'@'localhost" at lin...
Joelle_Lehner32 asked October 3rd 19 at 07:11
1
answer

How to create a procedure with SQL queries?

How to create a procedure with input parameters which changes in the database for example: name of the district head, when you enter the name of district and name of the head of the district.
Shana_Lubowitz asked October 2nd 19 at 19:52