| Author |
Message |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 5613 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:41 pm: |
    |
sql server aithay, idi try maadi... http://stackoverflow.com/questions/11794487/sql-server-how-t o-find-hexadecimal-character-in-a-table |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 5612 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:38 pm: |
    |
Maverick:0x1 is hex value..
that is why I gave a query that searched for that hex value...looks like that did not work. |
   
Maverick
Legend Username: Maverick
Post Number: 49413 Registered: 01-2008 Posted From: 70.39.176.60
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:35 pm: |
    |
0x1 is hex value..why are u guys searching for x in regular strings? i dont get it |
   
Maharshi
Side Hero Username: Maharshi
Post Number: 3392 Registered: 02-2008 Posted From: 170.146.220.23
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:35 pm: |
    |
see if this works : SELECT * FROM Table_Name WHERE CHARINDEX(' ',Column_Name) > 0 |
   
Twitter
Legend Username: Twitter
Post Number: 33535 Registered: 10-2009 Posted From: 69.118.124.210
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:34 pm: |
    |
Humpty_dumpty:function overloading aa...rtrim kee 2 args eti
yes rtrim can be overloaded it takes leading char (leading char can be anything or just space) |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25762 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:33 pm: |
    |
Twitter: RTRIM(col_id, 'x')
function overloading aa...rtrim kee 2 args eti |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 5610 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:32 pm: |
    |
Humpty_dumpty:no result
May be this will be of help... http://stackoverflow.com/questions/9710185/how-to-deal-with- invalid-characters-in-a-ws-output-when-using-cxf |
   
Twitter
Legend Username: Twitter
Post Number: 33533 Registered: 10-2009 Posted From: 69.118.124.210
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:26 pm: |
    |
Humpty_dumpty:I want to know which row is messed up so that user can correct it from UI without doing a code update
select * from table where RTRIM(col_id, 'x') IN (select col_id from table) idhi try chei sub qry will return all ..outer qry will actually uses rtrim fn to search 'x' or ' ' .. |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25761 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:26 pm: |
    |
Maverick: its lot easier in java with whole set of string functions
i know the next option is to write a unit test to connect to prod db to fidn the bad row, which i dont want to do |
   
Maverick
Legend Username: Maverick
Post Number: 49412 Registered: 01-2008 Posted From: 70.39.176.60
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:23 pm: |
    |
Humpty_dumpty:it does a basic trim(). that does not catch white space coming somewhere in the text.
i think you should do more than that..and its lot easier in java with whole set of string functions..replace/replaceall should work |
   
Kaisersooze
Moderator Username: Kaisersooze
Post Number: 10294 Registered: 04-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:22 pm: |
    |
Humpty_dumpty:
sqlserver synatx theliyadhu bro..nenu ichindhi Oracle.good for reg expression sql server...syntax chusi kottei |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25760 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:21 pm: |
    |
Twitter:first aa service raasinodni peekei
M dharmaraju MA cnmaa naa idhi emaina |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25759 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:20 pm: |
    |
Maverick:cant ur program handle it in java itself?
it does a basic trim(). that does not catch white space coming somewhere in the text. i am not sure if anyone reading a text field codes for hex characters each time |
   
Kaisersooze
Moderator Username: Kaisersooze
Post Number: 10293 Registered: 04-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:18 pm: |
    |
select coulmn_name,regexp_substr(column_name,'[[:space:]]+[[:alnum: ]]+[[:space:]]+') from table_name string mundhu space and last lo space isthadhi...madhyalodhi any alpha numeric.if you have any other charcathers use [[:graph:]] after alpha |
   
Twitter
Legend Username: Twitter
Post Number: 33532 Registered: 10-2009 Posted From: 69.118.124.210
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:18 pm: |
    |
Humpty_dumpty:axis engine fails during marshalling and spits out below error
first aa service raasinodni peekei .. result set lo white space kooda handle seyaledha useles fello |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25758 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:18 pm: |
    |
Dreamcatcher:select * from table_a where col_a like '%' + CHAR(0x1) +'%'
no result
Gotcha:You can use REPLACE function to replace the characters while doing select if you don't want to change the value.
I want to know which row is messed up so that user can correct it from UI without doing a code update
Kaisersooze:select coulmn_name,regexp_substr(column_name,'[[:space:]]+') from table_name
sql server equivalent? |
   
Maverick
Legend Username: Maverick
Post Number: 49411 Registered: 01-2008 Posted From: 70.39.176.60
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:18 pm: |
    |
cant ur program handle it in java itself? |
   
Maharshi
Side Hero Username: Maharshi
Post Number: 3390 Registered: 02-2008 Posted From: 170.146.221.26
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:12 pm: |
    |
To remove space: select Column_Name, replace(Column_Name,' ','') as New_Column from Table_Name Finding white space position ante charindex function use chesi cheyachu |
   
Kaisersooze
Moderator Username: Kaisersooze
Post Number: 10292 Registered: 04-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:11 pm: |
    |
select coulmn_name,regexp_substr(column_name,'[[:space:]]+') from table_name |
   
Buduguuu
Hero Username: Buduguuu
Post Number: 18062 Registered: 01-2012 Posted From: 199.67.138.49
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:08 pm: |
    |
copy paste errors lo spaces eppudu leading or trailing untai most of the times. use trim function to remove unwanted spaces or characters at the begininning or end data huge aite query time teesukuntadi mari.. Pride of TFI, Nenokkadine - New_User,70 years TFI history lo ee cinema ki Sukumar padda kastam, inka ye director padi undadu. Commercial success ayyunte bavundedi |
   
Kaisersooze
Moderator Username: Kaisersooze
Post Number: 10291 Registered: 04-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:07 pm: |
    |
Humpty_dumpty:
do u know the column_name? |
   
Gotcha
Hero Username: Gotcha
Post Number: 14903 Registered: 02-2008 Posted From: 8.19.193.14
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:05 pm: |
    |
You can use REPLACE function to replace the characters while doing select if you don't want to change the value. This Andhra real estate is for sale. |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 5609 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:03 pm: |
    |
assuming you know which column it is failing on... |
   
Dreamcatcher
Side Hero Username: Dreamcatcher
Post Number: 5608 Registered: 11-2009 Posted From: 208.86.145.68
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 03:02 pm: |
    |
try this... select * from table_a where col_a like '%' + CHAR(0x1) +'%' |
   
Humpty_dumpty
Moderator Username: Humpty_dumpty
Post Number: 25757 Registered: 02-2009
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, April 07, 2014 - 02:59 pm: |
    |
One of my table columns has some invalid whitespace character as a result, axis engine fails during marshalling and spits out below error org.apache.axis2.AxisFault: Invalid white space character (0x1) in text to output at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) [axis2-kernel-1.5.1.jar] at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo (SOAPMessageFormatter.java:83) [axis2-kernel-1.5.1.jar] at org.apache.axis2.transport.http.AxisRequestEntity.writeReque st(AxisRequestEntity.java:84) [axis2-transport-http-1.5.1.jar] at org.apache.commons.httpclient.methods.EntityEnclosingMethod. writeRequestBody(EntityEnclosingMethod.java:499) [commons-httpclient-3.1.jar] Q: How do I find such characters using SQL query? THis probably happened due to user copy pasta from some other place |