Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
95 views

I am having a challenge with indexedDB keys not matching the record numbers. To correct this I need to cycle through the records and reset the ID to match the index. I am trying to form an array that ...
TJS101's user avatar
  • 510
2 votes
1 answer
62 views

Let's say I have a table CREATE TABLE mytable ( user_id bigint, someval text ) In my application, I want to lock and fetch every row for some given user_id e.g. 123 to do some additional ...
negimaster's user avatar
3 votes
1 answer
117 views

I'm using 17.0.6 version (and 13 yet, in another test) of ODBC driver against a PostGreSQL 17 database, I got an unexplicable error when, from a PowerBuilder 12 application using the ODBC, I call a ...
Andrea Ricci's user avatar
1 vote
1 answer
111 views

I have a large dataframe which I need to upload to SQL server. Due to volume of data, my code does the insert in batches. But, I am facing insert failure if the batch has more than 1 record in it. The ...
Abhishek Sourabh's user avatar
1 vote
1 answer
56 views

I have the following statements intended to CHECK/REORG tables in a loop. Partially, this works. BEGIN DECLARE SQLSTATE CHAR(5); DECLARE RetState CHAR(5); DECLARE SqlStmt ...
Dave Clark's user avatar
2 votes
1 answer
56 views

I confirmed the following syntax in the DB2 LUW v11.5 manual (we are running DB2 LUW v11.5.9). And apparently this syntax has been supported at least since v9.7! This is in a stored procedure and, ...
Dave Clark's user avatar
1 vote
1 answer
79 views

I'm using the sequelize-cursor-pagination package to implement pagination in my Node-Postgres application. I need to order my results based on a field from an included (associated) model, but the ...
droid's user avatar
  • 78
2 votes
0 answers
95 views

Declaring of cursors where data is through JSON format, I keep getting: Column is not valid at this position, expecting for, lock, select, table, values, with … -- Procedure to insert Project ...
Dronal Bhardwaj's user avatar
0 votes
1 answer
41 views

Environment OceanBase community edition 4.2.1 (MySQL Mode) Table transactions has 1M+ rows, partitioned by id. I'm encountering performance issues with a stored procedure in OceanBase. The procedure ...
user avatar
0 votes
1 answer
134 views

I'm trying to use a cursor inside another cursor. I'm facing a problem that's: I'm only be able of update one row of all the millions of rows, and the others are considered as 'not found' which is not ...
Nelson Soares's user avatar
-2 votes
1 answer
46 views

EmployeeName Date Salary1 Salary1_Percentage Salary2 Salary2_Percentage Alex A 2025-01-01 50 0 % 25 0 % Alex A 2025-02-01 100 100 % 50 100 % David C 2025-01-01 50 0 % 10 0 % David C 2025-02-01 100 100 ...
user2593362's user avatar
-2 votes
1 answer
122 views

I’m trying to write a script to purge all the tables (and views and functions and procedures) from the current dbo schema in the current database. Bolting together what I have learned from other ...
Manngo's user avatar
  • 17k
0 votes
0 answers
37 views

I searched extensively but I couldn't find clarity, whether Primary Key (In this case, composite of Foo1ID and Foo2ID) should be selected into foo_cursor, even if not used in procedure? Is it ...
NenadP's user avatar
  • 657
0 votes
1 answer
85 views

I have a master detail schema with two tables. I am using a cursor within another cursor to loop them both. BEGIN --set NOCOUNT ON; DECLARE Cur_Rule CURSOR LOCAL READ_ONLY FORWARD_ONLY FOR ...
altink's user avatar
  • 375
0 votes
0 answers
49 views

I am working with cursor pagination and sorting right now, for example you can paginate with cursor but you might also want it to be sorted in a certain field and direction for an API, i.e., api/?...
Richard Luo's user avatar
0 votes
1 answer
42 views

I have a dedicated Azure SQL environment where I am using a loop to get US States names like 'AB' or 'NY' etc and also geographical boundaries from the same table. Code and error below: DECLARE ...
IrfanClemson's user avatar
  • 1,779
0 votes
1 answer
100 views

I am using pymysql connector to do some inserts into my database. I am trying to return whether or not a record was added or updated. My code is import pymysql db = pymysql.connect(host='127.0.0.1',...
Bijan's user avatar
  • 8,816
1 vote
1 answer
71 views

When attempting to query a resultset with an offset and a limit with the OFFSET x ROWS FETCH y ROWS ONLY syntax outside of the inner cursor DECLARE l_hits SYS_REFCURSOR; BEGIN OPEN l_hits for ...
Joao Pereira's user avatar
0 votes
2 answers
102 views

I am running the following code to generate parallel files of a big table in a small amount of time, even thought I have to join all the files afterwards in the operating system. My environment is a ...
Roberto Hernandez's user avatar
0 votes
1 answer
103 views

I need to implement cursor based pagination on an endpoint which accepts a search query. The problem is that since rows will be ranked based on a relevance score derived from a full-text search in ...
iKingNinja's user avatar
0 votes
2 answers
133 views

Given: CREATE TYPE my_struct AS ( a int4, b text, c float4 ); DO $$ DECLARE my_cursor refcursor; my_value my_struct; BEGIN OPEN my_cursor FOR SELECT (1, 'a', 10.0)::my_struct; ...
yuri kilochek's user avatar
-1 votes
1 answer
136 views

In the following code I meant to select rows from a table of cities named fc where the COUNTY='Socorro County' and ORDERED BY NAME: fc="cities_copy" where_selection=""""...
NBC's user avatar
  • 59
0 votes
0 answers
60 views

I have a lot of databases on a bunch of servers that all have an identical schema. I current have been just building a string into $command (using STUFF) that is select * from [server1].[DBname1].dbo.[...
Tater's user avatar
  • 11
0 votes
0 answers
155 views

I have tag data that comes in individual rows with 3 types of events: Created, Modified and Deleted. Tag data has the action date as well as the tag_name and if there is a tag_value. Modified events ...
user27991894's user avatar
1 vote
2 answers
176 views

Here's a piece of code running on Python 3.10.5 - with sqlite3.connect("test.db") as db: cursor = db.cursor() cursor.execute("""CREATE TABLE IF NOT EXISTS testtable(id ...
styx's user avatar
  • 13
2 votes
1 answer
111 views

Background I recently had to fix a bug in an old WCF/Angular project. It is a To Do app that allows you to create tasks (A 'List' record) and mark it completed in 'ToDo' with some time calculations ...
Asad Koths's user avatar
0 votes
0 answers
338 views

I have a SQL cursor using which I loop over records in a table. I'm trying to do some error handling wherein the execution should stop, and cursor closed/deallocated. Based on my testing, if I do ...
variable's user avatar
  • 9,886
0 votes
0 answers
59 views

export const cacheRecommendations = async () => { const userCursor = UserModel.find({}) .cursor() .addCursorFlag("noCursorTimeout", true); let counter = 0; ...
Sir hennihau's user avatar
  • 1,874
0 votes
3 answers
1k views

I have a table, Customers, that has seven columns: ID, CustomerName, Address1, Address2, City, State, PostCode. I am trying to do cursor pagination via an API over the result set but the user can ...
Josh's user avatar
  • 10.6k
2 votes
2 answers
116 views

We have a couple of tables, let's call them Sections and SectionTimeWindows. Sections table contains data about sections of 'movement', which starts at a place, ends at a place and has a type. The ...
David Cholt's user avatar
2 votes
2 answers
84 views

I have the following table: Category Product Date Price C1 P1 01/01/2024 1 C1 P2 01/01/2024 2 C1 P3 01/01/2024 3 C1 P1 01/02/2024 4 C1 P2 01/02/2024 5 C1 P3 01/02/2024 6 C1 P1 01/03/2024 7 C1 P2 01/03/...
developer's user avatar
  • 1,621
0 votes
1 answer
541 views

I'm using node-postgres (pg) and its pg-cursor extension. I noticed when reusing the same connection between multiple cursors, it locks due to what I would assume that a single connection is only able ...
Daniel A. White's user avatar
0 votes
2 answers
2k views

I've been sitting all weekend, trying to figure out the implementation of cursor iterations in Snowflake procedure blocks. The goal is to create a dynamic procedure that when called checks all ...
Paul's user avatar
  • 17
1 vote
1 answer
141 views

Thank you for your help in advance. I've got a simple SP in Postgres: CREATE OR REPLACE PROCEDURE TEST_SP(INOUT _result_one refcursor = 'rs_resultone') LANGUAGE plpgsql AS $$ BEGIN open _result_one ...
Radek Matras's user avatar
0 votes
2 answers
119 views

I am trying to create a report that, among other things, lists how many new patients were seen in a particular month. A "new" patient is someone who has either 1) never been seen before, or ...
JohnT's user avatar
  • 13
1 vote
0 answers
68 views

CREATE OR REPLACE FUNCTION fpp2(cur IN INTEGER) RETURN INTEGER IS rows_processed INTEGER; BEGIN dbms_output.PUT_LINE('cursor_fp2:' || cur); rows_processed := DBMS_SQL.EXECUTE(cur); ...
chestnutsJ's user avatar
1 vote
1 answer
155 views

I have a database containing a table called client that has, among others, column names like id, first, last,... It is projected to extract each record and from it, assemble a PDF file named after ...
user10191234's user avatar
0 votes
1 answer
46 views

In this stored procedure for an inventory system I want to process a packaging order for a product in kg according to the type of container and its capacity in kg. This finally stores the existence of ...
Kibuya Shanon's user avatar
0 votes
1 answer
254 views

Below is the stored procedure I have created. It is the "Create" stored procedure. I am getting error while updating the data. SET SERVEROUTPUT ON; CREATE OR REPLACE PROCEDURE ...
Manoj Kumar Biroj's user avatar
0 votes
1 answer
79 views

I'm trying to declare two Cursors in a stored procedure but it shows SQL Error [1338] [42000]: Cursor declaration after handler declaration Cursor declaration after handler declaration Cursor ...
Sabri's user avatar
  • 1
0 votes
1 answer
95 views

I have the SINGLESTORE stored procedure shown here which is going into rowlocks while inserting 8 million rows. Inserting 60k-80k, it runs fine. The error that I am receiving is below. I am not sure, ...
sunny's user avatar
  • 3
-1 votes
1 answer
516 views

I want to create a procedure that uses cursor as an input in Oracle. I tried something like this: cursor cur is select * from table t1; and then also: create or replace procedure (I want to input ...
Bahy Mohamed's user avatar
0 votes
1 answer
168 views

I am trying to execute a raw update query using psycopg2 in django. The code is as below: from django.db import connection from psycopg2 import sql model_instances_to_update = [] for model_instance ...
Lax_Sam's user avatar
  • 1,139
0 votes
0 answers
74 views

Here’s a shorter message to ask for help on Stack Overflow: Hi everyone, I need help with the following function: def add_collection_content_vector_field(collection_name: str): ''' Add a new ...
Max Getuba's user avatar
1 vote
1 answer
63 views

I have temporary data that is being uploaded from an external source into empty SQL Server tables. But not always the same tables. I need these tables to be cleared after a MERGE procedure is run. The ...
Garry_G's user avatar
  • 309
0 votes
2 answers
140 views

I have a table and the columns are 'Name' 'Product' 'Type' 'Date' 'Type1' 'Date1' 'Type2' 'Date2'..... (till type23 date23) I want to stack Type1, Type2 under Type column and similarly Date1, Date2 ...
Twinkks's user avatar
-1 votes
1 answer
25 views

Create or Replace package SamplePackage As Cursor cur is select * from abc; refCurParam as ref cursor return cur%rowtype; Begin End SamplePackage; The above package used in SP in order to define type ...
venkatesh kancheti's user avatar
0 votes
1 answer
86 views

I have created a table function with SQL Macro. When I want to use this within a procedure and cursor, it will not work. CREATE OR REPLACE TYPE VARCHAR2_TYPE IS OBJECT (p VARCHAR2(4000)); ...
Georg's user avatar
  • 1
0 votes
1 answer
63 views

I am using Hana data studio (SQL) and need to write a cursor that takes the original dataset, makes column age set to 0 and sets the the fiscal quarter to the iterated value over a distinct list of ...
Frankie Contreras's user avatar
-1 votes
1 answer
150 views

I need help with optimizing a cursor or changing the code completely. I have the below requirement: Create column Sequence grouped by ColumnA, ColumnD and GroupA. StartA is used for sorting. Have ...
JubaMita's user avatar

1
2 3 4 5
19