78

Java.sql.SQLException: parameter # 9 has not been set

 3 years ago
source link: https://www.codesd.com/item/java-sql-sqlexception-parameter-9-has-not-been-set.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Java.sql.SQLException: parameter # 9 has not been set

advertisements

hello I'm trying to execute mssql stored procedure from hibernate. Procedure has 8 input parameters and no output. But I get java.sql.SQLException: Parameter #9 has not been set whuli executing.

<sql-query name="insertMyData" callable="true">
        { ? = call InsertMyData(?,?,?,?,?,?,?,?) }
</sql-query>

Java invocation

Query query = m_entityManager.createNamedQuery("insertMyData");
        query.setParameter(1, transaction.getGuid());
        query.setParameter(2, new Date());

........ other parameters specified

Stored procedure

CREATE PROC dbo.insertMyData
    @ID uniqueidentifier,
    ...... 7 more parameters
AS
BEGIN
    INSERT INTO dbo.TestData VALUES (
        @ID,
           ........ 7 more parameters

    )
END


My bad with my earlier suggestion:

According to https://forum.hibernate.org/viewtopic.php?f=1&t=986612

Another person with the same issue, got it resolved by removing the "? =" since there was not 'return' defined for the quesry. I would suggest you try the same.

Hope this helps.

Related Articles

java.sql.SQLException: parameter X is not an OUT parameter

I'm struggling with getting the result OUT variable from a MySQL stored procedure. I get the following error: java.sql.SQLException: Parameter number 3 is not an OUT parameter The stored procedure looks like this: CREATE DEFINER=`cv_admin`@`localhost

java.sql.SQLException Parameter index out of range

While am using this code it shows java.sql.SQLException Parameter index out of range (1 > number of parameters, which is 0): private void cmd_searchActionPerformed(java.awt.event.ActionEvent evt) { try{ String sql = "select * from STD where Name l

Eclipse Checkstyle plugin (eclipse-cs) Error Property has not been set

I try to use eclipse-cs (eclipse checkstyle plugin) in our Eclipse 4 teamproject. The idea is that we define one checkstyle.xml for our team and have this checkstyle.xml under sourcecontrol. The Project structure looks like this Root Checkstyle.xml P

What is the warning Ant & ldquo; Reference * has not been set to runtime & hellip; & Rdquo; mean?

Since the upgrade from Ant 1.6.5 to 1.7.1, my build output starts off with: Warning: Reference project.classpath has not been set at runtime, but was found during build file parsing, attempting to resolve. Future versions of Ant may support referenci

(Hibernate) java.sql.SQLException: field 'xxxx' has no default value

Hibernate is throwing the following exception: Caused by: java.sql.SQLException: Field 'catVerb_id' doesn't have a default value People say that the problem is with my PKs that haven't the AUTO_INCREMENT statement, however you can see that I've done

java.sql.SQLException: ORA-24335: can not support more than 1000 columns

I have a java program which inserts a list of store numbers with a unique ID called pilotID into an Oracle database with the following syntax: pilotDAO.insertPilotStores(pilotID, storeList); storeList is a List<String> storing store numbers, and pil

java.sql.SQLException: The statement does not run

I am trying to create a simple SQLite database program that could create a database, a table, insert and retrieve data. How can I fix this? I keep getting the exception: java.sql.SQLException: statement is not executing package databaseproj; import j

The 'Name' parameter is required by @Test on the method parameter but has not been marked @Optional

Here is my selenium testng script and XML file. I am getting the error message. Please help me how to proceed this Err MSG : Parameter 'Name' is required by @Test on method parametertest but has not been marked @Optional import org.testng.annotations

& ldquo; Invalid Parameter Number: Parameter has not been set & rdquo; Insertion of data

UPDATE I was making a petty mistake when listing the VALUES. I should have put ":username" and not ":alias". I suppose the answer credit to this question is free reign for anyone who wants it? Or do I delete the question? ORIGINAL I've

How do I know if a boolean has not been set (or disabled) at all?

I have a peculiar problem. I work with Thrift with java at the backend and php on the front end. We have a situation where I ask the user for a boolean value for three variables. The user can either set them to true or false, or not set them at all.

why sql gives me an error & ldquo; Invalid parameter number: the parameter has not been set & rdquo;

Today I got error Invalid parameter number: parameter was not defined in my yii app while updating data . then i come to know that my sql database table column contains name with "-" symbol i.e "table-post" etc . Then i changed "-

Yii SQLSTATE [HY093]: Invalid parameter number: Parameter has not been set

I have looked at the other questions concerning this error message, but all appear to have something to do with a miss match between a parameter and its binding, or missing bindings, or something like that. Here is my code. Can anyone here see the er

SQLSTATE [HY093]: Invalid parameter number: Parameter has not been set

I am new to PDO. I get stuck, now I am here. I tried basic crude in PDO and get error invalid parameter: parameter was not defined from Update part. Please help me? public function update_by_id($data) { $id = $data['student_id']; $name = $data['stude

Procedure or function 'sp _ ***' expects that parameter '@', which has not been supplied

I am trying to execute a stored procedure but getting following error: Procedure or function 'SP_DELETE_DESIGN_PARAMETERS' expects parameter '@DESIGN_ID', which was not supplied. Below is my stored procedure. I am trying to execute it in SQL need res

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK