Skip to main content

All Questions

-1 votes
1 answer
53 views

Cursor in stored procedure in MySQL

I have this code: DELIMITER // CREATE PROCEDURE GetColumnMaxLengths(IN schema_name VARCHAR(255), IN table_name VARCHAR(255)) BEGIN DECLARE done INT DEFAULT FALSE; DECLARE column_name VARCHAR(255); ...
user9846973's user avatar
-1 votes
2 answers
161 views

Loop used to execute a procedure multiple times fails during nth run

I have the following code running a loop DECLARE @table_name NVARCHAR(100) , @sql NVARCHAR(MAX) , @sp_name NVARCHAR(100) , @rep_dt nvarchar(10) , @min_rep_dt DATE DECLARE mycursor CURSOR LOCAL STATIC ...
Chezza's user avatar
  • 19
0 votes
2 answers
436 views

Snowflake - how can I update user roles dynamically with a cursor?

I'm trying to to perform the code below. My goal is to loop through users and update their role only if it's empty. Is this possible using a cursor this way (I want to call this from a stored ...
Gilladriel's user avatar
0 votes
2 answers
354 views

Updating via cursor is taking a lot of time

I'm performing address association by taking the addr_id and updating it in two tables (same table and another table) for different columns. However it is taking huge time even though I use parallel ...
Cool_Oracle's user avatar
1 vote
2 answers
765 views

Conversion Example of Stored Procedure Cursor within a Cursor for MySQL and MariaDB from Advantage

I am migrating from Advantage Database Server 11 to MySQL 8.0.33 and also testing MariaDB 11.0.2. I haven't landed on which one to use yet but I know I will need to use cursor variables and cursors ...
Daniel's user avatar
  • 515
0 votes
1 answer
348 views

Mysql procedure throw error when cursor fetch 0 rows

I have a Mysql table as follows: CREATE TABLE `login_info` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` varchar(50) NOT NULL, `device_id` varchar(50) NOT NULL, `timestamp` bigint(20) ...
Another coder's user avatar
0 votes
1 answer
85 views

How to create a procedure to insert values into a newly added column?

Here I need to create a procedure to insert values into a newly added column. This table has two primary keys. company_no and part_no.This table has 10 records and I need to update the newly added ...
user12864747's user avatar
0 votes
0 answers
170 views

MyBatis select returning String, string, cursor

I have a stored procedure that returns a string(return_code), String(return_msg), cursor(p_out_refcursor). The application is using annotation based @Select("{ call SAMPLES.INSERT_T_SAMPLE ( &...
Amigma's user avatar
  • 1
0 votes
1 answer
1k views

Update table using CURSOR and procedure result

I have stored procedure which returns a value and I want to loop all rows in table to update column. I'm using MSSQL. I was planning to use CURSOR but I wasn’t able to get it work: SELECT SeqNrColumn ...
Sjobie82's user avatar
-1 votes
1 answer
69 views

Need to know how to write a condition in pl/sql

enter image description hereenter image description hereI have a Table-A which contains columns: ID, original ID and unique Id,percentage1,percentage2 Table-B which contains the columns:All IDs, ...
Manu's user avatar
  • 3
1 vote
1 answer
106 views

Inconsistent datatypes: expected CURSOR got CLOB

While compiling this piece of code as oracle stored precedure, I get the error "Inconsistent datatypes: expected CURSOR got CLOB". I don't know how to put CLOB variable in output cursor. ...
Ali Khoshsafa's user avatar
0 votes
1 answer
2k views

Is there a way to return a Stored Procedure Return_Value to the python script executing it?

I am writing a python script that should update a log table and notify me of it. Part of this script is to execute a SQL Server stored procedure. I get an email telling me the status of the script as ...
PoenaMan's user avatar
0 votes
1 answer
3k views

pl/sql loop through the table and pass the each entry of the row to a stored procedure

I have a table with three columns (table_name, column_name, data_type), I am trying to pass values of these three columns as parameter to a stored procedure in a loop. Now, I have a developed very ...
pawan rakesh's user avatar
1 vote
1 answer
3k views

Redshift cursor doesn't exist after creating a stored procedure

I was following the aws redshift documentation to create a stored procedure and return the data results by using a cursor. It throws an error saying cursor doesn't exist even though I do exactly same ...
Ugur Yilmaz's user avatar
1 vote
1 answer
4k views

ORACLE ERROR PLS-00302: component must be declared when using with external table

I am new to PLSQL I want to create a procedure which inserts records into a table(AUDIT_LOG ) and simultaneously create a file with the records inserted into the table. The records are checked for ...
Syed Iftekharuddin's user avatar

15 30 50 per page
1
2 3 4 5
32
X