Oracle Stored procedure support v2.0
От: Аноним  
Дата: 20.07.11 16:02
Оценка:
Hello,
Does BLT support Oracle stored procedures. I've tried numerous methods, described below to get it to work but no luck. The stored procedure updates a table with several values. This is the stored procedure, a small test procedure.

DROP PROCEDURE BETA_AUTO_UPDATE;
/

CREATE OR REPLACE PROCEDURE BETA_AUTO_UPDATE
       (
          AutoId IN NUMBER,
          Rule  IN NVARCHAR2,  
          Nam  IN NVARCHAR2,
          Loc IN NVARCHAR2
       )
IS
BEGIN 

    UPDATE Beta_Auto
       SET RuleGuid = Rule,        
        Name = Nam,
          Location = Loc
     WHERE Id=AutoId;
     
EXCEPTION 
 WHEN OTHERS THEN 
             RAISE_APPLICATION_ERROR(-20001, 'ERROR OCCURED DURING UPDATE');


END BETA_AUTO_UPDATE;
/


Tried the following

            DbManager.AddDataProvider(new OdpDataProvider());
            DbManager OracleDb = new DbManager("BetaOracleDBConn");


            Beta_Auto Betar = new Beta_Auto();
            Betar.ID = 1;
            Betar.Name = "Jim";
            Betar.RuleGuid = "jlDKDKDKDKDKDKp";
            Betar.Location = "LocDLDLDLDLDtor";

            OracleDb.SetSpCommand("Beta_Auto_UPDATE",       
            OracleDb.CreateParameters(Betar)).ExecuteNonQuery();


That didn't work.

Tried this

            [ActionName("UPDATE")]
            public abstract void Update(Beta_Auto Auto);


That didn't work.

Tried this.

            [SprocName("Beta_Auto_Update")]
            public abstract void UpdateByParam(
                [Direction.InputOutput("ID", "RuleGuid", "Name", "Location")] Beta_Auto Auto);


That didn't work.

Tried this.

              [SprocName("Beta_Auto_Update")]
              public abstract void UpdateByParam(int Id, string RuleGuid, string Name,  
                                                 string Location);


That didn't work. Tried this.

              [SprocName("Beta_Auto_Update")]
              public abstract void UpdateByParam(int Id, string RuleGuid, string Name,  
                                                 string Location);


Also tried this.

              [ActionName("Update")]
              public abstract void UpdateByParam(int Id, string RuleGuid, string Name,  
                                                 string Location);


That didn't work.

Set the trace level on odp.net to 7. Saw that the call was being made, but couldn't see any parameters. Swapped out XE (thought it might have been a licensing problem as db was bigger that 5GB) for enterprise Oracle. Didn't work.

Create a new user, datafile, tablespace, as assigned all roles and privs, including Execute Any Procedure to the user. Didn't work.

I've stumped. All of the above work for sql server.

I've posted this in stack overflow as well.

Thanks.
scope_creep
Re: Oracle Stored procedure support v2.0
От: Alex Krasov Россия  
Дата: 20.07.11 17:20
Оценка:
А>Hello,
А>Does BLT support Oracle stored procedures. I've tried numerous methods, described below to get it to work but no luck. The stored procedure updates a table with several values. This is the stored procedure, a small test procedure.

have you tried the tests supplied with the BLT? I personally didn't used the Oracle ones, but tests for the MSSQL were helpful for me. You can find the DB creation scripts for each supported database under the "Data\Create Scripts" folder.
Re[2]: Oracle Stored procedure support v2.0
От: Аноним  
Дата: 20.07.11 19:24
Оценка:
<span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">Здравствуйте, Alex Krasov, Вы писали: А>>Hello, А>>Does BLT support Oracle stored procedures.</span> Hello, Alex Krasov, you wrote: A>> Hello, A>> Does BLT support Oracle stored procedures.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">I've tried numerous methods, described below to get it to work but no luck.</span> I've tried numerous methods, described below to get it to work but no luck.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">The stored procedure updates a table with several values.</span> The stored procedure updates a table with several values.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">This is the stored procedure, a small test procedure.</span> This is the stored procedure, a small test procedure.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">AK>have you tried the tests supplied with the BLT?</span> AK> have you tried the tests supplied with the BLT?</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">I personally didn't used the Oracle ones, but tests for the MSSQL were helpful for me.</span> I personally didn't used the Oracle ones, but tests for the MSSQL were helpful for me.</span> <span onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left">You can find the DB creation scripts for each supported database under the "Data\Create Scripts" folder.</span> You can find the DB creation scripts for each supported database under the "Data \ Create Scripts" folder.</span>

Yes, I've tried the unit test and no joy. I took the single stored procedure test sql, created the SP in Oracle and tried the various method described before hand with SP name, and it didn't work. Then finally I took the BLT.4 codebase and added a console app and debugged stepped through codebase, watching it prepare the params and calling the SP, and it didn't work.

The last thing I did was created and old style ADO.NET OracleConnection with OracleCommand and adding OracleParameter's method of calling an SP and that worked fine, on XE and 11g. It did the update. I've tried the BLT.4 on 10.2 XE and 11g Enterprise and complete fail. I suspect is sending null params, but I don't know for sure.

It works flawlessly in SQL Server 2008/2005. Its works pefectly.

It's really starting to get me down. It needs to work.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.