Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:01:03+00:00 2026-06-03T00:01:03+00:00

I’m mapping an Oracle 11g stored procedure as command in a NHibernate’s .hbm.xml mapping

  • 0

I’m mapping an Oracle 11g stored procedure as command in a NHibernate’s .hbm.xml mapping file, like this:

  <class name="Person" table="PERSONS">
    <id name="Id" column="COD_PERSON" />
    <property name="Name" column="NAME" />

    <property name="AuditField1" column="AUDITFIELD1" />
    <property name="AuditField2" column="AUDITFIELD2" />
    <property name="AuditField3" column="AUDITFIELD3" />

    <sql-insert>exec PKG_PERSONS.insert_sp ?,?</sql-insert>
  </class>

This is the stored procedure:

create or replace package body PKG_PERSONS is
  procedure insert_sp(pcod_person  persons.cod_person%type, 
                      pname        persons.name%type) is
  begin
    insert into persons(cod_person, name) values(pcod_person, pname);
  end;

From this mapping, I’m expecting ‘Id’ and ‘Name’ properties would be send as parameters, but for sure, this isn’t happening; I’m getting this error from Oracle: ORA-01036: illegal variable name/number. NHibernate shows some logs in Console window and it seems like NH tries to map all properties, included AuditFields, to invoke the stored procedure.

Maybe is this the source’s error?

Is this the expected behaviour?

Is it possible to specific what properties send as parameter with NH3/Oracle?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:01:04+00:00Added an answer on June 3, 2026 at 12:01 am

    Confirmed, NH tries to send as parameter every entity’s properties mapped to <sql-insert>/<sql-update> stored procedures, but you could make exceptions with insert/update=false.

    Another issue was the right sintaxis to execute Oracle11g’s stored procedure, this is the mapping that works for me with NH3.3 and Oracle.DataAccess 4.112.2.0:

      <class name="Person" table="PERSONS">
        <id name="Id" column="COD_PERSON" />
        <property name="Name" column="NAME" />
    
        <property name="AuditField1" column="AUDITFIELD1" insert="false" update="false" />
        <property name="AuditField2" column="AUDITFIELD2" insert="false" update="false" />
        <property name="AuditField3" column="AUDITFIELD3" insert="false" update="false" />
    
        <sql-insert check="none">begin PKG_PERSONS.insert_sp(:p0,:p1); end;</sql-insert>
      </class>
    

    I had to redefine the parameter’s order, because Id property is send at last position:

    create or replace package body PKG_PERSONS is
      procedure insert_sp(pname        persons.name%type,
                          pcod_person  persons.cod_person%type
                          ) is
      begin
        insert into persons(cod_person, name) values(pcod_person, pname);
      end;
    

    Maybe this will help somebody else,
    Thanks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm parsing an XML file, the creators of it stuck in a bunch social
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.