Java.sql.SQLException: parameter # 9 has not been set
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.
Java.sql.SQLException: parameter # 9 has not been set
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
java.sql.SQLException Parameter index out of range
Eclipse Checkstyle plugin (eclipse-cs) Error Property has not been set
What is the warning Ant & ldquo; Reference * has not been set to runtime & hellip; & Rdquo; mean?
(Hibernate) java.sql.SQLException: field 'xxxx' has no default value
java.sql.SQLException: ORA-24335: can not support more than 1000 columns
java.sql.SQLException: The statement does not run
The 'Name' parameter is required by @Test on the method parameter but has not been marked @Optional
& ldquo; Invalid Parameter Number: Parameter has not been set & rdquo; Insertion of data
How do I know if a boolean has not been set (or disabled) at all?
why sql gives me an error & ldquo; Invalid parameter number: the parameter has not been set & rdquo;
Yii SQLSTATE [HY093]: Invalid parameter number: Parameter has not been set
SQLSTATE [HY093]: Invalid parameter number: Parameter has not been set
Procedure or function 'sp _ ***' expects that parameter '@', which has not been supplied
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK