![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| dev/rmt 0.1 block size is 0; variable; must be 1024 fixed. | MariaLuisa | AIX | 2 | 12-08-2006 04:27 AM |
| ftp UnixWare File Size Problem | Niraj Gopal Sha | Shell Programming and Scripting | 1 | 06-18-2005 08:29 AM |
| Variable Testing for size | jango | AIX | 4 | 08-19-2004 11:46 AM |
| Max size of variable | lesstjm | Shell Programming and Scripting | 1 | 09-27-2002 10:16 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Variable Size Problem
Hello Everyone, I am currently working with a DB2 (ver 8.1) table (Newly Created) and I am running a basic DB2 Select query into a variable. The field and it's size are VARCHAR(20). Since I need to pass the variable through some java I have noticed that when the results come back from the query there are extra spaces. Even if I use the RTRIM or LTRIM I still receive the spaces. Is there a way to set a variable lenght before the results of a query are passed to it? I would like to do the following, Code:
variable1=`db2 -xn "length(rtrim(field1)) from Database"` if (( variable1 == 16 )) then set $variable2 lenght to 16 fi variable2=`db2 -xn "select LTRIM(RTRIM(field1)) from Database"` Then I can pass $variable2 through the java. I know it doesn't make much sense but it's what I need, hopefully. thanks in advance...........
Last edited by Bob_Loblaw; 09-17-2007 at 04:36 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|