Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

General discussion forum about all databases other than SqlBase.
colea

Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by colea » 04 Dec 2008, 20:01

I'm maintaining some code that uses SqlPLSQLCommand to call an Oracle 10g stored procedure. Two of the parameters to this procedure are arrays. When these arrays have 33 or fewer elements in them then everything performs fine, however if they have 34 or more elements then the application crashes (and so does the IDE when I was debugging it).

I'm pretty sure it's a problem with the SqlPLSQLCommand and not the stored procedure or Oracle, as traces from Oracle indicate that the procedure is never called and the same procedure called with the same values passed as parameters runs sucessfully when called from the SQLPlus Worksheet. The same traces indicate that DBMS_DESCRIBE.DESCRIBE_PROCEDURE is being called before the crash, which (I understand from some googling) is called inside SqlPLSQLCommand.

I was wondering if this is a known issue, and if so is there a way around this problem? Any suggestions would be greatly appreciated.

Thanks,
Gus

colea

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by colea » 07 Jan 2009, 18:45

Is there more information I could provide that would help with answering this?

I should point out that I have no real experience with using Team Developer, I am just maintaining a product that has been written using it.

tlauzi

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by tlauzi » 08 Jan 2009, 07:18

Hi,

I would say this is a known issue (for me).
We do not use SqlPLSqlCommand and arrays, because in our tests, we had also crashings (not with 33 elements but with about 1000).
I could not remember all, but there are some other limitations...

Polymorphic functions/function overloading is possible in Oracle, but then SqlPLSqlCommand stops working an crashes.
e.g.
procedure test(str1 varchar2(32) );
SQL Console: execute test('teststring'); -- works
TD: SqlPLSqlCommand(" test(str1) ") -- works

now modify...
procedure test(str1 varchar2(32) , str2 varchar2(32) default NULL);
SQL Console: execute test('teststring'); -- works
TD: SqlPLSqlCommand(" test(str1) ") -- doesn´t work anymore

Regards,
Thomas L.

User avatar
Steve Leighton
Site Admin
Site Admin
New Zealand
Posts: 342
Joined: 05 Mar 2017, 20:57
Location: Stroud, England <--> Tauranga, New Zealand

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by Steve Leighton » 12 Jan 2009, 00:35

Suggestion:

Try SqlOraPLSQLPrepare() then SqlOraPLSQLExecute(). You can test the Prepare works before performing the Execute.
Note that I always make the Array params either Global variables( least desirable ) or instance variables and the Stored Proc call a Functional Class function. I run TD4.1 with Ora10G and declare my arrays as a fixed lenth value eg Number: ianNumberArrayParam[50]. Works just fine.

eg:

!!
!! First set up your SQL statement to include the Stored Proc name + array params
!!

Code: Select all

Set sSql = 'ims.ims_test.Do_Test ( :isStringParam, :inNumberParam,                                      :iasStringArrayParam, :ianNumberArrayParam, :isError    )'
!!
!! Second , check if Prepare works, and then Execute if success
!!

Code: Select all

When SqlError
                    Call ichSqlSession.LogSqlError( 'Prepare' )
                    Set ichSqlSession.sSql = sSql
                    Set bRet = FALSE

If bRet and SqlOraPLSQLPrepare( ichSqlSession.GetHandle(  ), sSql )

!!
!! Check if Execute works
!!

Code: Select all

       
          When SqlError
                    Call ichSqlSession.LogSqlError( 'Execute' )
                    Set ichSqlSession.sSql = sSql
                    Set bRet = FALSE

          If bRet and SqlOraPLSQLExecute( ichSqlSession.GetHandle( ) )
                  Return TRUE !! or whatever
          Return FALSE  !! or whatever

Greetings from New Zealand
Steve Leighton

Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand

www.banksidesystems.co.uk

Image

colea

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by colea » 26 Jan 2009, 17:29

Thanks for your help guys.

Steve, your suggestion worked perfectly.

mikewill
Great Britain
Posts: 5
Joined: 03 Jan 2018, 11:46
Location: Geneva

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by mikewill » 19 Feb 2010, 10:20

A bit late but just to add to the knowledgebase...
I found that connecting local dedicated cursors to use with PLSQLCommand would eventually cause a crash. Unfortunately it was rather intermittent, though if the cursor were connected early on in the run it would be ok. In the end, connecting a global cursor on startup to use with PLSQLCommand fixed the problem.

kohhc

Re: Array passed to Oracle with SqlPLSQLCommand crashes TD4.2

Post by kohhc » 04 Mar 2010, 05:07

Hi,

any feedback whether Unify is investigating this array issue? I am using TD5.2 with parameters of 100 elements into the procedure. Used to work perfectly in TD3.0.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 6 guests