I have Spring JPA. I have a query like this in sql oracle: I have a CrudRepository in which I use the above query in native mode, like this: I get ORA-00933: Passing myValue as integer between quotes I get ORA-01867 Passing myValue as integer without quotes I get ORA-00933 How to do it? Answer See comments on question, there
Tag: oracle
converting string to number inside Jooq select – Oracle
I am using jooq’s DSL.select in my Java code, I have scenario where I need to determine the index from a string. Used DSL.substring(“hello123”,6,1) to get the desired index value as string, but no method supporting in DSL to convert it to a number. Example: the nested substring need to be converted into number Answer Converting strings to numbers Use
Create a table “ca” as a statement using values of another tables but while inserting new values, the values of “ca” doesn’t change
I want to calculate turnover like in new table called ca ‘ I have tables article (idarticle, priceBuying, priceSale, quantity), and table command have (idarticle, quantity, dateSale), I want to calculate turnover automatically everyday and insert into ca , but the problem is when I insert new values into command the values of ca not updating using oracle db. Answer
Compiling a function or procedure using JDBC removes all records from all_statements view
After I execute/compile a stored procedure/function, I query the all_statements view to extract the statements that were in the stored procedure/function like below: However, one of my applications run the following code: Whenever this code is run, the all_statements view is cleared. Even if I execute this same function like below: There are no new entries in all_statements showing the
Why can’t a bind variable be used from ojdbc with Oracle JSON_ARRAY() in the presence of FORMAT JSON
In Oracle, the following query: Produces the following JSON document: When I try to run this query with bind variables from JDBC like this: Then I’m getting: I’m using these versions: Database: Oracle Database 21c Express Edition Release 21.0.0.0.0 – Production ojdbc: com.oracle.database.jdbc:ojdbc11:21.5.0.0 Is this a bug? Can it be worked around? Answer In my opinion, it’s a bug in
how to update multiple records with jdbc with oracle and spring boot
I am trying to update several records from spring jdbc but this is not working what am i doing wrong? does not respond when I make a request, but the data in the array is arriving, try without array and the same thing happens. I am sending an array of objects to be able to update but I get to
Date conversion format Java to DB different format
I’m making a code in java that executes an Oracle database procedure The format I have to put there in the procedure when I run through the database is dd/MM/yyyy. I have to send this date from my java code using a CallebleStatement setDate with the date yyyy-MM-dd (which is the Date format in java) When this CallebleStatement is executed,
Vertx JDBCCLient insert BLOB into database
I used vertx 3.9.12 and JDBCCLient. How to insert image to BLOB column? Thank in advance Answer Unwrap the io.vertx.ext.sql.SQLConnection to java.sql.Connection and then create a Blob that you add to the params:
ORA-29531: no method in class (java)
I have a java procedure inside a package in Oracle: and it is defined something like this: When I try to call the procedure like this: it throws an error: Does anybody know the problem? Answer The int primitive and the Integer class are not the same thing, so your declaration does not match the Java method. It should be:
Kotlin CLOB to String
I have a function in Oracle that returns a CLOB. In Java I can use the following code to execute this function and fetch the result: Oracle function definition in my Repository class: Conversion to String: What’s the equivalent code in Kotlin or any other way to convert the Clob to String? Answer It’s absolutely legal use @Query annotation in