Solved TD-15932: String sent from TD to Ora11g: chars missing

Post found bugs and possible workarounds.
Andreasa

TD-15932: String sent from TD to Ora11g: chars missing

Post by Andreasa » 17 Sep 2012, 16:40

My application is sending a regular string to oracle and the oracle package is receiving only part of it.
For ex: instead of receiving string "ABCD", Oracle package receives "AB" .
There is no RTRIM or nothing of that matter, just a string going to oracle as a string.

My thought was that TD is sending unicode chars or something of that matter. Is there a way to see what type of characters TD6 is sending to oracle?
I saw the "font" types for the outline but that doesn't fix my issue.


Thanks!

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Dave Rabelink » 17 Sep 2012, 16:47

How is the column you are referring to defined in Oracle?
And are you using String or Long String variable in TD?

Does the String contain UNICODE or ANSI text?

A sample would help for more details to be able to see what the issue could be!
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Andreasa

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Andreasa » 17 Sep 2012, 17:52

The TD6 code, call the package WORK.WORK_INFO

Code: Select all

Call SqlPLSQLCommand( hSql, 'WORK.WORK_INFO( SqlUser, dDateTime, sEKey, sWorkID, sWorkPwd, nError )' 
and here are the values it sends/returns:
(see img)

Ora11g package is accepting a varchar2 (user_id)
and I purposely modified the package so that: work_id = user_id. That way It can show me in TD6 what oracle receiving(sWorkID).

Code: Select all

CREATE OR REPLACE PACKAGE BODY MPS."WORK" AS
  PROCEDURE work_info
    (
      user_id     IN   varchar2 ,
      dkey        IN   date ,
      ekey        IN   varchar2 ,
      work_id     OUT  varchar2 ,
      work_pwd    OUT  varchar2 ,
      err_code    OUT  number
    )
  IS
    invalid     EXCEPTION ;
  BEGIN
    /*
    ** Validate USER_ID
    */
    IF (user_id IS NULL) OR
       (RTRIM(user_id) != RTRIM(user)) THEN
      work_id := user_id;
      work_pwd := RTRIM(user_id);
      err_code := 1 ;
      RAISE invalid ;
    END IF ;
    END IF ;


So in summary, the SqlUser variable in TD6 will be the string that oracle will receive as user_id
and it will display it as sWorkID on TD6.

As you can see on the image, SqlUser "U3D9" suppose to be the same sWorkID but instead is "U3".
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Jeff Luther » 18 Sep 2012, 00:19

I talked with our router developer about this and he referenced a TD fix (TD-15932, fixed for TD v6 SP4) that might have been relevant. But there are a couple missing pieces of info. needed to help narrow this problem down:

** Where in the TD insert --> DB, then fetch back to TD flow does the truncation happen? Is the INSERT OK and inserts 4 chars? And only the SELECT fetch back is the problem? Or after an INSERT are there only 2 chars?

** What's the specific v6 you have? (We always need the SP # as well). BTW, SP7 was released a couple weeks ago. If you do not have the latest SP I recommend you upgrade and test again.

** What's the underlying CREATE TABLE statement look like that the SP is referencing. If original DB table uses 'byte' semantics, like this:
CREATE TABLE TEST_TAB( TEXT VARCHAR2(100 BYTE), ... );
then that is not supported for TD v6 since it supports Unicode (2-byte) chars. This is what Dave asked too.


If you still have a problem then we need a complete simple self-contained test case (TD app. with SQL to create a test table, create SP, insert a string, then fetch it back).

Andreasa

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Andreasa » 18 Sep 2012, 19:40

Thanks Jeff!
I'll install the latest service pack and test it again.

Hopefully it works :)

Andreasa

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Andreasa » 18 Sep 2012, 22:35

The SP 7 fixed my issue! :)
Thanks!

Jeff Luther

Re: TD-15932: String sent from TD to Ora11g: chars missing

Post by Jeff Luther » 18 Sep 2012, 22:40

The SP 7 fixed my issue!
YAY!! Thanks for letting us know. Issue... [SOLVED] !

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 0 guests