cancel
Showing results for 
Search instead for 
Did you mean: 

PB 12.6 - ASE SP using Image Data (broken)

Former Member
0 Kudos

Hi Everyone;

  ** The Problem **

  Just a heads-up on using PB 12.x with SAP's ASE DBMS where a Stored Procedure is used to either Insert or Update a LOB column (ie; IMAGE) in a given the ASE database using the PB native ASE client. The following is a test scenario I just did to prove that the PB DB Interface native driver (PBASE126.dll) is broken when trying to use this ASE feature added since ASE v15.5. My tests were using PB 12.6 build 4088 and ASE newest release 16.0 (can also produce on ASE 15.7).

The Diagnosis ...

1)  Create a Table that has a LOB column, for example:

2) Create a Stored Procedure to Insert/Update the LOB table that accepts a LOB data type as input, as follows:

3) Call the SP from your PB 12.6 application, as follows:

4) Check the ASE DB table using TOAD (for example). You will see that only 1 byte of the Blob was passed.

5) A DB trace supports the above.

The conclusion ... 

It looks like to me that the PBASE126.dll DB Client interface driver truncates the binary data stream prematurely!

My guess is that PB was never updated to properly support ASE SP based LOB arguments.

Regards ... Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

I opened bug report cr798587 on this issue. 

I will get back to you once I have more information on this problem.

Thank you.

Beverly Duquette

Former Member
0 Kudos

Hi Beverly;

   Thank you!

FYI: I have a small PB 12.6 test application I can send you if that helps. Just let me know.  

Regards ... Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Everyone;

** Work Around **

  Until SAP fixes the native ASE DB Client interface driver to properly handle a LOB Stored Procedure binary data stream, I have been able to MacGyver ( link provided for you younger PB developers ) a work around to the SP / Image processing, as follows:

After many cups of ....

1) Use a non-ASE DB driver ... like ODBC for example:

    SQLCA.DBMS = "ODB"

    SQLCA.AutoCommit = False

    SQLCA.DBParm = "ConnectString='DSN=CSC_PPT_CI;UID=xxxxxxxx;PWD=yyyyyyy',ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

2) In ODBC, you must disable large data chaining ...

  String ls_db_cmd = "Set Chained OFF"

  EXECUTE IMMEDIATE :ls_db_cmd USING SQLCA;

Note: the above command must be done before the call to the SP!

3) Now call the SP as expected using the data in your PB Blob variable ..

    DECLARE Insert_Lob PROCEDURE FOR st_cip_ins_lob_test

                   @Emp_Name = :ls_name, 

                   @Emp_Pic = :lblb_image

                   USING SQLCA;

    EXECUTE Insert_Lob;

4) You will now see the Blob data properly in the DB table by the SP

   (I used TOAD for SAP to verify this) ....

"What a beauty, eh" (as they say in Canada when something works)!  

Regards ... Chris

PS: Have you hugged your DataWindows today? 

Former Member
0 Kudos

Hi Chris,

This issue is now fixed in the latest PB 12.6 EBF--EBF26232: 12.6 SP00 PL09 (build 4098).

You can download the EBF at:

-- go to https://launchpad.support.sap.com

-- Select the Software Downloads tile
-- Select Support Packages & Patches
-- Select 'By Alphabetical Index (A-Z)'
-- Select 'P'
-- Select Sybase PowerBuilder
-- Select Sybase PowerBuilder 12.6
-- Select Windows Server on IA32 32Bit
-- Select the EBF26232: 12.6 SP00 PL09 (build 4098).

Thank you.
Beverly Duquette

Former Member
0 Kudos

Hi Beverly;

  Thank you for the feedback on this issue!  

Regards ... Chris

Former Member
0 Kudos

Chris,

Thank you for:

1. The clear, complete, and illustrated description of the problem and troubleshooting performed.

2. Thinking of us yournger generations who seldom  read more than three lines or nothing without

    pictures, audio or video

3. The McGuyver analygy, like we say in the USA, "priceless".

I guess some older guys, still "ROCK". You are still the man Chris!

Jean-Pierre

Former Member
0 Kudos

Hi Jean-Pierre;

  Thank you for the kind words. 

Regards ... Chris