197 questions
2
votes
0
answers
320
views
StoredProcedureQuery with Multiple IN parameter not working after hibernate(6) and java (17) upgrade
After upgrading to Java 17 and hibernate 6, the sequence of IN parameter was changed. I was able to fix this by changing the sequence while sending the IN parameter to the procedure.
But I am ...
-1
votes
1
answer
47
views
Multiple tables as output parameters in Procedure using hibernate
CREATE OR REPLACE PACKAGE BODY Pkg_name
IS
PROCEDURE proceure_Name (
Id IN Long,
startDate IN DATE,
EndDate IN DATE,
Table1 OUT Table1_Name%ROWTYPE,
Table2 OUT ...
0
votes
1
answer
308
views
JAVA Spring calling a Stored Procedure expects 3 parameters when there should only be 2
my repository is as following:
@Repository
public interface StatisticsRepository extends JpaRepository<CampaignStatisticModel, Integer> {
@Procedure(value = "getCampaignStatistics&...
0
votes
1
answer
155
views
CallableStatement for DB2 StoredProcedure throws BadSqlGrammarException - Descriptor index not valid (10>9)
Stored Procedure:
CALL STORED_PROCEDURE_PROCESS_ONE_TIME(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Stored Procedure Variables:
d Stored_Procedure_Process_One_Time_...
d pi
d xterm ...
0
votes
1
answer
810
views
Stored Procedure - Snowflake - get details of all columns and rows
I am trying to get 4 column names from the table which has 10 rows and I want to loop through all rows in that table and pass those column values as parameters into some other stored procedure.
How ...
0
votes
2
answers
732
views
DB2 stored procedure to run multiple insert & update SQL statements using List array from Java application
I want to use a DB2 stored procedure to run multi insert & update SQL statements from my Java application. I have prepared below procedure that contains error.
In this implementation, I first want ...
1
vote
1
answer
2k
views
I am trying to run a SQL query inside a Javascript Snowflake Stored Procedure but it isn't working and it keeps failing to initialise
I am trying to create a Javascript Stored Procedure in Snowflake where the javascript executes a sql query. I am new to javascript and I stole all of it from an existing one that already exists (and ...
0
votes
0
answers
365
views
Db2 LUW Java SP issue
I am trying to run a Stored Procedure which has registered as an external Java Program to Db2. Whenever I call it, I keep getting the error:
SQL4304N Java stored procedure or user-defined function
&...
0
votes
0
answers
54
views
Calling pkg and Stored procedure, but it give me syntax error
I am trying to call the pkg and the procedure in java, as below:
public void rebuildIndexes() {
Query query = getEntityManager().createNativeQuery("BEGIN BFPA_ARCHIVING....
1
vote
1
answer
437
views
Oracle DB Java Stored Procedure: line starting with hash sign #
I have inherited an old Oracle 12c database, which I'm running on a local Oracle 19c server. The database contains the following Java Stored Procedure
create or replace and compile java source named ...
0
votes
0
answers
776
views
Oracle21c stored procedure and ora-29540
Originally, I was trying to tie together Oracle Database (21c) with RabbitMQ, to enable more efficient microservice communication between the database and a Docker environment (Swarm mode). I found ...
1
vote
1
answer
3k
views
Exit the stored procedure and RAISE error in Snowflake stored procedure like BREAK or RAISERROR in SQL Server
I have a stored procedure which executes multiple queries and for each of those queries I have a try and catch block as shown below. If there is an error, I capture and insert into a LOG table.
...
0
votes
2
answers
532
views
calling sqlj.install_jar from jdbc?
I have a python snippet that I try to port to java. The aim is Gradle but I could not get that to work, so I figured I would start with plain JDBC. The python code looks like this:
import argparse
...
-1
votes
1
answer
2k
views
Spring Boot - more cleaner or elegant way to pass multiple parameters to stored procedure spring data repository
how pass multiple parameters as DTO or Entity class in arguments method of Repository interface Spring Data
i have one procedure that receive multiple parameters of type IN and i have issue with my ...
0
votes
2
answers
925
views
how to get the data out of a stored procedure when the data is a 'clob' on an IBMi using DB2?
I am accessing a IBMi running DB2 from a java JVM. I have a stored procedure that returns a CLOB
and I want to access the clob from Java.
The sql for the stored procedure is:
CREATE OR REPLACE ...
0
votes
1
answer
707
views
Can I run an external file in a Snowflake stored procedure?
if I have an R script that generates a table and I wanted to insert that into an existing datatable in Snowflake every day, could I automate that using a stored procedure?
Is there some functionality ...
0
votes
0
answers
265
views
JDBC oracle stored procedure , handling nested object?
I am trying to invoke an Oracle stored procedure , which has a combination of nested Object and tables as below ,
CREATE OR REPLACE PROCEDURE MYSCHEMA.MY_PROC(
p_obj_school IN OUT OBJ_SCHOOL) IS .....
5
votes
0
answers
629
views
How to call simple select Procedure that using Multiple tables from MySQL using JPA
I have a stored procedure that is returning results from multiple tables
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetProjectAndClientOverview`()
BEGIN
SELECT ( SELECT count(*) FROM ...
2
votes
0
answers
2k
views
How to create and run stored-procedures / functions using h2 database
I am using h2 database for running component test case whereas in development postgres is used.Now, function which I created in postgres works fine and business logic as well, but facing issue while ...
1
vote
0
answers
206
views
Spring storedProcedure: org.springframework.dao.InvalidDataAccessApiUsageException
This is my stored procedure. But there is InvalidDataAccessApiUsageException
Entity:
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@NamedStoredProcedureQuery(name = "app....
0
votes
1
answer
332
views
Snowflake 'get' statement within stored procedure not working
Problem statement: snowflake 'get' statement does not work inside a snowflake stored procedure.
CREATE OR REPLACE PROCEDURE SP_UNLOAD_DYNAMIC("prefix" varchar)
RETURNS varchar(1000)
...
1
vote
3
answers
1k
views
Replace all instances in a string
I have the below Snowflake Javascript Stored procedure where I need to replace multiple instances of a string in an sql statement.
CREATE OR REPLACE PROCEDURE MYSCHEMA.CountryDelete(COUNTRY VARCHAR)
...
0
votes
0
answers
430
views
Oracle Apex, Apache PDFBox java stored procedure issues
Some background: in my app, there are some pdf reports. But, these pdf reports need to be "image" based and I was told that the report server is unable to do this. The call to the report ...
0
votes
1
answer
1k
views
Parameter emp_name was not defined for stored procedure get_empoyee_details
Am a bit confused, am trying to call a stored procedures using spring boot JPA. Have created a simple procedure and call the procedure using JPA’s @NamedStoredProcedureQuery annotation.
For some ...
4
votes
1
answer
2k
views
Javascript Procedure to create tables in Snowflake
I have tried below code to create tables that listed in tables array, but i get error:
JavaScript compilation error: Uncaught SyntaxError: Unexpected end of input in CREATE_TABLES_SP at '
CREATE OR ...
2
votes
1
answer
5k
views
Spring Boot invalidDataAccessApiUsageException - OUT/INOUT Parameter is not available
i'm using an Oracle stored procedure in Spring Boot which has some IN/OUT parameters.
When i'm getting an out parameter it throws an exception invalidDataAccessApiUsageException: OUT/INOUT Parameter ...
0
votes
2
answers
258
views
How to write several item in table at the same time using ORMLite
I use ORMLite on a solution made by server and clients.
On server side I use PostgreSql, on client side I use SQLite.
In code, I use the same ORMLite methods, without taking care of the DB that is ...
0
votes
1
answer
3k
views
How to set Array in StoredProcedureQuery..setParameter()?
There is a code like this:
StoredProcedureQuery query = this.em.createStoredProcedureQuery ("NameOfProcedure");
query.registerStoredProcedureParameter ("list_of_ids", Array.class, ...
0
votes
1
answer
405
views
Can we Use Snowflake Tables functions in the procedure?
Experts,
I am trying to use tables function inside the snowflake procedure. However it throws me an error.
CREATE PROCEDURE
.....
....
extcnt ="select count(*) from table(information_schema....
0
votes
2
answers
1k
views
DB2 external java jar file stored procedure error
I have been trying to call a java jar file from DB2 stored procedure as external jar.
Below is my external jar file code.
package connection;
public class Connect {
static Connection con =...
0
votes
1
answer
554
views
JDBC connection from Java stored procedure running in Oracle Database 12.2 is not working
We are getting an error message when attempting to create an Oracle db connection from a java stored procedure running within an Oracle database. We have isolated to the connection and it is working ...
0
votes
2
answers
3k
views
Snowflake Stored procedure Copy into Temporary table
Question is related to Snowflake and Snowsql. That said I'm trying to within a stored proc create a temp table and then 'copy into' this temp table from azure blob storage.
I'm manually executed the ...
0
votes
0
answers
405
views
How to write Java code inside Oracle procedure
I have created a Java source and compiled it and wrapped it in an Oracle 19c procedure with the jdk+jre 1.8.0._201. I'm connecting to a suite that uses TLS 1.2 with mutual authentication(with a ...
0
votes
1
answer
3k
views
Calling stored procedure with an IN and OUT Parameter from Spring Batch
I am attempting to execute a stored procedure from Spring Batch, the stored procedure has two parameters, an IN parameter and OUT parameter. What I want is to get the result set and the out parameter ...
1
vote
0
answers
190
views
Is it possible to dynamic query to stored procedure?
I have a Spring boot application. I need a feature to dynamically query the stored procedure. What I mean by dynamically,
@NamedNativeQuery(name = "getCustomFoo", query = "select * from ...
0
votes
0
answers
475
views
Java Spring JDBCtemplate take time for first request
I am using Java and Spring Jdbctemplate to hit a stored procedure and fetch the data. This is deployed as war to Weblogic server. Problem I face is the first request is much slower (10 secs) or it ...
0
votes
1
answer
2k
views
Java Stored Procedure DB2 issue
In my class I have created simple method below. This class also has a main function in it. I am calling getRes() from my DB2 stored proc.
public static void getRes() {
System.out.println("Start");...
0
votes
1
answer
624
views
The stored procedure output is returning null
I was asked to write a stored procedure for calculating the net salary of the employee if we pass
employee Id as a parameter and the formulas were given and the I had to write a Java program for the ...
4
votes
1
answer
3k
views
SnowFlake Stored Procedure Multi Threading
Being new to Snowflake I am trying to understand how to write JavaScript based Stored Procedures (SP) to take advantage of multi-thread/parallel processing.
My background is SQL Server and writing SP, ...
1
vote
2
answers
2k
views
Oracle Java stored function - Inconsistent data type for CLOB
I have a CLOB column that stores html code. To parse it, I've written a Java stored function -
CREATE or replace FUNCTION parse_html(value in CLOB)
RETURN CLOB
AS LANGUAGE JAVA NAME 'MyClass....
0
votes
1
answer
204
views
Unable to connect remote Oracle DB in java stored procedure
I am trying to connect to a remote oracle database in java stored procedure in a traditional way. I am able to call the java stored procedure successfully. But I receive the exception "Missing In or ...
0
votes
1
answer
217
views
Using Stored Procedures via java and sql plus
We manage a java application that allows to select lines by setting boxes and validate.
I want to create a second process to reproduce the same actions of the java application but in shell. Looking ...
0
votes
2
answers
654
views
Procedure or function 'search_words1' expects parameter '@result', which was not supplied
I am trying to call procedure from java spring boot. I am passing array as a parameter to procedure and from the procedure I want to return the list back to java as a resultset. Please let me know ...
0
votes
1
answer
1k
views
java.sql.SQLException: Could not find stored procedure
[dbo].[GetUserCredentials]
@Company varchar(255),
@SchedType varchar(255),
@ShiftHours varchar(255),
@UserRole varchar(255),
@UserDesc varchar(255),
@UserOwner varchar(255)
select ......
0
votes
1
answer
1k
views
Call Java SOURCE using function
I need to find out the Windows username using SQL, PL/SQL or Java. So far I've found some java code that can return a Windows username. I put the Java code in my schema database, but can't create a ...
0
votes
1
answer
239
views
Calling main function from java stored procedure
I have loaded the class file of a java program (that fetches data from an excel file and pushes it to a database and making connection to database using values from properties file) into the SQL ...
0
votes
1
answer
2k
views
How Do I Find SSL Certificate Full Path And Use in a StoredProcedure to call an API
How do I find the ssl certificate path? That one installed by VisualStudio, to be more expecific when we use .NET Core and run "dotnet dev-certs https --trust" at the console...
Could you guys help ...
1
vote
1
answer
708
views
Aggregate function with JavaScript query API in Azure Cosmos DB
I'm working with CosmosDB stored procedure and user defined function.
I have to write a stored procedure that return the max of four fields of a collection.
In Sql I write:
SQL MAX(A) AS ...
0
votes
1
answer
918
views
Azure cosmos db stored procedure not work
I'm looking to MSDN how to write a stored procedure in CosmoDB.
I find the following simple example :
var helloWorldStoredProc = {
id: "helloWorld",
serverScript: function () {
var ...
0
votes
1
answer
2k
views
Multiple stored procedures on two or more (Oracle) databases with Spring Boot?
I am setting up a Java Spring project with multiple StoredProcedures to two completely different Oracle databases.
It is not allowed to use any auto-generated SQL.
I didn't find anywhere a complete ...