The following returns any record with the carriage return character in the accountid field of table accounts. (db2)
select *
from accounts
where accountid like '%' || char(x'0D') || '%'
Search This Blog
Code snippets and memory joggers
Tuesday, July 21, 2009
Wednesday, July 15, 2009
Thursday, July 2, 2009
bash substring
${i:0:21}
where i is a string, 0 is the start point and 21 the length.
eg
i='123456789'
echo ${i:1:4}
produces '2345'
echo ${'123456789':1:4}
does not work,
> echo ${'123456789':1:4}
-bash: ${'123456789':1:4}: bad substitution
where i is a string, 0 is the start point and 21 the length.
eg
i='123456789'
echo ${i:1:4}
produces '2345'
echo ${'123456789':1:4}
does not work,
> echo ${'123456789':1:4}
-bash: ${'123456789':1:4}: bad substitution
Subscribe to:
Posts (Atom)
About Me
- Keith
- I love to travel and meet new people, motorbikes, moving my body through dance, martial arts and yoga. I'm a lifelong learner interested in how things work, and the way people think and make their decisions. My choice of superpower would be to speak with someone and understand them completely, including their intention and for me to be able to communicate my intention to them clearly in their own language. As an Amazon Associate, I may earn from links to qualifying purchases.