- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: make field manditory with digits then the rest...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2005 04:23 AM
тАО11-15-2005 04:23 AM
I know this can be done, but can I also in the same field, make the first 10 character digits then the user can enter in what the want.
So make the field 25 character length, first 10 is manditory digits. Rest can be what the want to enter.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2005 04:30 AM
тАО11-15-2005 04:30 AM
Re: make field manditory with digits then the rest can be fluff
typeset MYVAR=""
typeset -i STAT=0
read MYVAR # read a value
echo "${MYVAR}" | grep -E -q -e '[0-9]{10}.*'
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Ok"
else
echo "Bad"
fi
Man grep for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2005 04:33 AM
тАО11-15-2005 04:33 AM
Re: make field manditory with digits then the rest can be fluff
Can all this been done in Oracle?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2005 12:16 PM
тАО11-15-2005 12:16 PM
SolutionYou can do this using the length or the substr functions and then compare.
Declare the variable to be varchar2(25).
Eg:-
ws_text varchar2(25)
Then verify if the entered variable value is not less then 10 characters using the length function [eg: length(ws_text < 10 then prompt again].
Or
Verify that substr(ws_test,1,10) should not be null or spaces and then compare if theya re numeric and not alphanumeirc.
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2005 01:54 PM
тАО11-15-2005 01:54 PM
Re: make field manditory with digits then the rest can be fluff
Attached is an example to check and see if the user defined text is less than 10 characters and then compare the first 10 characters to be numeric.
The example assumes the user enters text is ├в 123testing├в . First it will check if the length is less than 10 characters. As it is 10 characters, the script will loop for the first 10 characters to compare for non-numeirc (any other characters other that 0 to 9).
IA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2005 05:49 AM
тАО11-17-2005 05:49 AM