cancel
Showing results for 
Search instead for 
Did you mean: 

space issues in the query result

shaji_chandran
Participant
0 Kudos

Hi,

I would like to fetch some data from the database using SQL Query. The query retuns some data including spaces. When I print the result of the query in xml format I am not able to see the spaces over there. It is getting trimmed. Instead of space if I use any other character the query is returning it properly. I can convert this character to space again in my transaction using string replace method. But this will be time consuming. Is there any way in MII where my query can return data including space also.

Please let me know if you have any idea about this

Thanks in advance

Shaji

Accepted Solutions (0)

Answers (1)

Answers (1)

agentry_src
Active Contributor
0 Kudos

Shaji,

Do you mean the contents of a field is a space (or more than one space), or that the values include spaces at the beginning or end of the contents? Or something else. Also what kind of database and version are you trying to use?

Regards,

Mike

Edited by: Michael Appleby on Apr 4, 2011 6:35 PM

shaji_chandran
Participant
0 Kudos

Hi Mike,

Yes the value includes space can be at the begining or the end. Currently all the spaces at the end are getting trimmed

Please let me know if you have any solution for this.

Much appreciated

Shaji

agentry_src
Active Contributor
0 Kudos

Shaji,

Why do you need the spaces at the end of the contents of a field?

And does the field contain mixed alphanumeric values or is numbers and spaces?

Also please provide the information on the database vendor and version. You may find out that the driver for the database removes the trailing spaces. Not sure how you would check that. But maybe others will have some ideas on it.

Regards,

Mike

shaji_chandran
Participant
0 Kudos

Hi Mike,

Thanks again for your response. I am retrieving the space from the database because I would like to send this value in the IDOC. This will be the value for my SDATA tag in IDOC. That is the reason I am fetching space from database.

My Oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production. I do not think the driver is trimming the space. Actually the issue is when I get the query result in the form of xml it is trimming the space.

Thanks again

Shaji

agentry_src
Active Contributor
0 Kudos

Hi Shaji,

What happens when you run the query in TOAD or via a webservice (or any other data retrieval method)?

I think you are fighting the wrong battle. I would get rid of the requirement to have the trimmed spaces and use some other mechanism in your IDoc. Spaces carry extra baggage when being processed. Using them as data is not a very good practice except in the normal course of text data. Remember the KISS rule.

Regards,

Mike

Edited by: Michael Appleby on Apr 5, 2011 3:38 PM

shaji_chandran
Participant
0 Kudos

Hi Miche,

The query works fine when I run through Toad. I am getting spaces at the end of data. But when I run the query inside MII transaction and print the result in the form of XML spaces are getting trimmed.

Thanks

Shaji

agentry_src
Active Contributor
0 Kudos

Hi Shaji,

Not sure what else I can tell you. Perhaps someone else has some ideas.

Regards,

Mike