Category "stored-procedures"

Create stored procedure Insert and Update

I'm trying to insert and update queries at the same time in stored procedure, but I get a syntax error: #1064 - You have an error in your SQL syntax; check the

How to update MySQL column/row when datetime column < now?

I am making a platform where people can make bids on items for a price. I want to make it so that after a the expire datetime of the item, the database will aut

SSIS Execute SQL Task continue execution after completion of Oracle stored procedure

I have an Oracle stored procedure I am trying to execute in SSIS Execute SQL Task. This stored procedure involves refreshing materialized views. For each and ev

Find which where clause is the most troublesome

Problem background I am trying to pin down to what condition(s) are causing no records / rows the most, so to allow me to find the root cause of what data in th

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

DBMS stored procedure- get values from existing table

I have a table Age_cal, Vaccine Information and Medical_information table as follows: I am trying to write a stored procedure where, I will be able to insert

Export a CSV file in Oracle database by using stored procedures

I am using the following stored procedures (Oracle Database) to export the output of the query to a CSV file CREATE OR REPLACE PROCEDURE run_query(p_sql IN

Alter table add column if not exists in MySql

I need to make an alter table via migration on a node:14 server with umzug. The code is : IF NOT EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_

Calling a Sybase stored procedure from another stored procedure without displaying called stored procedure results

I am calling a Sybase stored procedure X from another stored procedure Y. Following the answer to a similar question , I create a #tmp_table to hold the results

How to remove quotes in sybase ASE

I have a string: "16680,16678,16677,16676,16675,16672" Which I got from the Stored procedure passed parameter while calling it. I want to insert these records

Reading incremental results from stored procedure

I am working on a stored procedure that will perform time consuming query (> 30 seconds) inside the engine (arrays, temp tables, ...). The stored procedure r

Stored Procedure Snowflake - time formatting issue

var get_end_time = "select CURRENT_TIME()"; var time_sql = {sqlText: get_end_time}; var time_create = snowflake.createStatement(time_sql); var time_exec_end = t

which is best using delete or truncate when i need to delete all data from table?

I work on sql server 2017 I need to delete all rows from table student_course but I don't know which is best for use delete from student_course OR truncate tab

Snowflake: Flag infinite loops in hierarchical data without using cursor in Snowflake

I'm struggling with a SQL code performance issue, while trying to identify in advance circular references of a dataset with approximately 1.5 MO rows candidates

How to create a function in PL/SQL and return output

I am try to create a function that will table input to function and return me output My code : create or replace function details(keyword varchar2 , depid varch

How to handle 2 OUT user-defined custom data types from Java Spring Data JPA @NamedStoredProcedureQuery defined on @Entity class?

UPDATE: I have tried implementing the SQLData interface for my Financial.class and PersonalInfo.class Java POJOs defined on my @NamedStoredProcedureQuery for th

Can not safely replay call when trying to assign and use a variable in procedure

I am trying use the data from a column in one table as column aliases of another table. DECLARE var1 VARCHAR(20), var2 VARCHAR(20); BEGIN WITH TABLE1

Attempting to INSERT values into a MySQL DB from C# code within a form, but getting "Column cannot be NULL

All - thanks in advance for your time. So, background info - I am trying to create a form for contact registration using C# to pass the information into my MyS

VBA stored procedure SQL Server

I'm trying to send data from excel spreadsheet to sql server. The code runs properly but the change of status is not done. Before those steps, I already added d

Creating procedure that add value when it doesn't exist (Syntax error)

I'm trying to create a procedure that add a value that doesn't exist but I'm currently getting a syntax error. I don't know how to correct the error. Any help w