How to select username contains only 7 strings
from dba_users, how to select username contains only 7 channels?Select decode (length (username)?) Please help. I just need to print the users whose name is exactly 7 charactars.
Try something like
SELECT username FROM dba_users WHERE LENGTH (username) = 7;
Tags: Database
Similar Questions
-
How to select valid dates only
If I have a table with a column varchar2 as below, how to select records that contain only valid dates? As there is no 2010-04-31, so I need only to bring on 2010-04-30, which is a valid date.
Select '2010-04-30'd from the double. "
Union of all the
Select '2010-04-31'd from the double. "
I'm on Oracle 10.2
Published by: Rinne on April 23, 2010 11:15Hello
Tubby wrote:
An option using SQL only, although something like that, I tend to go with the solution of francs to a user defined function. Because if you store dates as strings, you're likely to have more than just 1 kind of "bad" data in the string.If you try a pure-SQL solution, make sure that it does not raise an error when d is an absolute stupidity (for example, when d = "TOTAL GARBAGE").
Do something like this:WHERE CASE WHEN d IS NULL THEN 'Missing' WHEN TRANSLATE ( d , '012345678' , '999999999' ) != '9999-99-99' THEN 'Invalid format or non-numeric' WHEN SUBSTR (d, 1, 4) = '0000' -- or test for implausible years, e.g. "< '1900'" THEN 'Invalid year' WHEN SUBSTR (d, 6, 2) NOT BETWEEN '01' AND '12' THEN 'Invalid month' WHEN SUBSTR (d, 9, 2) NOT BETWEEN '01' AND TO_CHAR ( LAST_DAY ( TO_DATE ( SUBSTR (d, 1, 7) -- no need for "|| '01'" , 'YYYY-MM' ) ) , 'DD' ) THEN 'Invalid day' WHEN d BETWEEN '1582-10-05' -- If necessary AND '1582-10-14' THEN 'Julian-Gregorian calendar change' ELSE 'Okay' END = 'Okay'
In my opinion, it intercepts all possible errors in common dates of the time.
Published by: Frank Kulash, April 23, 2010 12:57
-
Contains only contains one and not - how PLSQL
Hi all
I'm writing a plsql code I need some advice.
How can I optimize contains only - all - contains contains not in PLSQL.
For Ex:
If l_string1 ContainsOnly "ABCDEFGHIJKL" (a set of values)
If l_string2 ContainsAny ' + -/'
If l_string3 ContainsNot "1234567890"
Thank you
Aman
Hello
If you are really determined to do not post sample data, and then publish an issue involving sample data of people who want to help you already, or readily available, such as the tables in the scott schema or HR.
For example, consider the ename column of the table scott.emp, which has these values:
ENAME
----------
ADAMS
ALLEN
BLAKE
CLARK
FORD
JAMES
JONES
KING
MARTIN
MILLER
SCOTT
SMITH
TURNER
WARD
Say you're interested in finding the enames which consist exclusively of letters from the 'A' series of 'n', i.e.:
ENAME
----------
ALLEN
BLAKE
KING
Here are 3 ways to do it. (I produce these results
ENAME NR L R
---------- -- -- --
ADAMS
ALLEN OK OK OK
BLAKE OK OK OK
CLARK
FORD
JAMES
JONES
OK OK OK KING
MARTIN
MILLER
SCOTT
SMITH
TURNER
WARD
just to test 3-way at the same time and to ensure that they are equivalent. You might what to use conditions in a WHERE clause, and not a CASE expression.)
This is the query that produced the above results:
SELECT ename
CASE
WHEN NOT REGEXP_LIKE (ename
, '[^A-N]'
)
AND THEN 'OK '.
END AS nr
CASE
WHEN LTRIM (ename
, "ABCDEFGHIJKLMN".
) IS NULL
AND THEN 'OK '.
END as l
CASE
WHEN REGEXP_LIKE (ename
, '^[A-N]+$'
)
AND THEN 'OK '.
END AS r
FROM scott.emp
ORDER BY ename
;
In reply #5, you have shown that you already know how to find what lines that contain all the letters
OTHER THAN « A » ' n '. To find the containing enames
ONLY ' ' 'N', you can simply use the NOT operator. In other words, an ename contains ONLY A - N if (and only if) it does not any letter ANOTHER THAT A - N. This is the approach used in the column above nr. However, I think that the other ways (column l and r) are better; l is more effective.
-
How to select record Datestamp Maximum
It's data.
The number Type Datestamp
IM10134 001 was 10413 Open 2010-07-19 07:51:43.000
IM10134 001 has 10424 Status Change-2010-08-02 09:45:27.000
IM10134 001 A 10425 provider external assignment 2010-08-02 09:45:27.000
IM10134 001 A 10426 update 2010-08-02 09:47:49.000
I want results for the following fields. So the result is
The number Type Datestamp
IM10134 001 A 10426 update 2010-08-02 09:47:49.000
How to select this folder only
Kindly help me.You can try:
SELECT x.number,y.thenumber,y.type,x.date_stamp FROM (SELECT number,MAX(datestamp) date_stamp FROM table_name GROUP BY number) x, table_name y WHERE x.number = y.number AND x.date_stamp = y.datestamp; /
-
Selected pass contains a string indicator combo box when you press the Enter key
Hello
How to pass selected contains a string indicator combo box when you press the enter keyboard key?
Right now I use a button to send the command selected in the combox to string indicator.
The photos shows a combo box with the button that I use to send to the indicator as example.
After the user selects the text to pass, "send the cmd" button must be pressed to pass the string.
I need to pass the selected string when the user press enter on the keyboard rather than press the button 'send cmd '.
Kindly to you needing help.
Hello
You can use a structure of the event to capture keystrokes and filter, transmit only the drop-down list box "value of the indicator of channel when you press the return or enter key."
Let me know it the joint allows an example (in LV 8.6).
-
How to change the paragraph style to each paragraph that contains only one anchored object?
Hello
I have a document in word that should be converted in indesign. The document contains instructions, each step followed by an image.
I managed to import the document into Indesign and applied a paragraph with numbering style to everything (text, image).
Now, how do I change the the paragraph style to each paragraph that contains only an image? I need to get rid of the numbering.
Thanks in advance.
If the images are all anchored objects, you can use find/replace to find the anchor point and change the paragraph style only once for all paragraphs.
-
check if a string contains only some characters
I'm working on a java program that converts the Roman numbers. The user enters a string, and I need to check to make sure that it contains MDCLXVI and if he doesn't I will get them the input again string. I thought I'd do a while loop but I'm not sure if it's the smart way to make or the syntax to perform the check.
Here was a thought on the control with a while loop, but I've never used it before and maybe build evil.
My Code is as follows:while (!Pattern.matches("MDCLXVI", firstRoman)) { System.out.print("Not a valid Roman Number please try again"); firstRoman = firstRoman.toUpperCase(); }
Once they enter in the it, I want to check to make sure that it has characters MDCLXVI and if it contains any other characters then I will provide a new object Scanner keyboard to try again and if it fails again, it will go to the option to try again until they put in a string that contains only the characters above. I don't know where to go here to get the while loop has worked. New to Java and I got my program work properly when I put good known numbers of novel, but I want to take incorrect entries.// Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase();
Any help would be appreciated.
Thank you
Wally
I put the code for my main program and my class below just in case. I have already met the requirements of the teacher if the project is done, I'm just trying to improve.
CLASS:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; import java.util.Scanner; import java.util.regex.Pattern; /** * * @author wsteadma */ public class mynameProject6 { /** * @param args the command line arguments */ public static void main(String[] args) { // Used for testing String firstRoman; String secondRoman; Scanner keyboard = new Scanner(System.in); // Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase(); // Ask for user to input secondRoman Number System.out.print("Enter your second Roman Number:"); // add the Roman Number to the String variable secondRoman = keyboard.nextLine(); // Add the name input into the name variable secondRoman = secondRoman.toUpperCase(); //Creating first instance of Roman Numbers class Roman firstNumber = new Roman(firstRoman); Roman secondNumber = new Roman(secondRoman); System.out.println("Printout of the created roman numbers"); //Prints out the Roman Number firstNumber.printRoman(); secondNumber.printRoman(); // Convert Roman to Decimal firstNumber.setDecimal(firstRoman); secondNumber.setDecimal(secondRoman); System.out.println("Viewing the Decimal values for the two defined instances"); //Prints decimal Numbers firstNumber.printDecimal(); secondNumber.printDecimal(); System.out.println("Adding the Roman Numbers and returning new Roman value"); Roman romanAdd; romanAdd = firstNumber.addRoman(secondNumber); romanAdd.printRoman(); System.out.println("Subtracting the Roman Numbers and return new Roman value"); Roman romanSub; romanSub = firstNumber.subRoman(secondNumber); romanSub.printRoman(); } }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; /** * * @author wsteadma */ public class Roman { private String romNumber; private int decNumber; public Roman(String rNumber) { romNumber = rNumber; } public String getRoman() { return romNumber; } public int getDecimal() { return decNumber; } public void printRoman() { System.out.println("The Roman Number is " + romNumber); } public void printDecimal() { System.out.println("The Decimal Number is " + decNumber); } // Converts a roman number string into a decimal value public int setDecimal(String romNum) { int charValue = 0; char[] characters = new char[romNum.length()]; //System.out.println("romNum length is " + romNum.length()); for (int counter = 0; counter < romNum.length(); counter++) { characters[counter] = romNum.charAt(counter); //System.out.println(characters[counter]); } for (int sCounter = 0; sCounter < romNum.length(); sCounter++) { if (characters[sCounter] == 'M' || characters[sCounter] == 'm') { charValue += 1000; } else if (characters[sCounter] == 'D' || characters[sCounter] == 'd') { charValue += 500; } else if (characters[sCounter] == 'C' || characters[sCounter] == 'c') { charValue += 100; } else if (characters[sCounter] == 'L' || characters[sCounter] == 'l') { charValue += 50; } else if (characters[sCounter] == 'X' || characters[sCounter] == 'x') { charValue += 10; } else if (characters[sCounter] == 'V' || characters[sCounter] == 'v') { charValue += 5; } else if (characters[sCounter] == 'I' || characters[sCounter] == 'i') { charValue += 1; } } decNumber = charValue; return charValue; } // Converts a decomal number to a roman number public String setDec2Roman(int decNum) { String newRoman = ""; while (decNum >= 1000) { newRoman += "M"; decNum -= 1000; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 500) { newRoman += "D"; decNum -= 500; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 100) { newRoman += "C"; decNum -= 100; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 50) { newRoman += "L"; decNum -= 50; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 10) { newRoman += "X"; decNum -= 10; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 5) { newRoman += "V"; decNum -= 5; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum > 0) { newRoman += "I"; decNum -= 1; //System.out.println(decNum); //System.out.println(newRoman); } return newRoman; } public Roman addRoman(Roman newRom) { int totRom = newRom.setDecimal(newRom.romNumber) + decNumber; romNumber = newRom.setDec2Roman(totRom); return new Roman(romNumber); } public Roman subRoman(Roman subRom) { int totRom = decNumber - subRom.setDecimal(subRom.romNumber); romNumber = subRom.setDec2Roman(totRom); return new Roman(romNumber); } }
While (!.) Pattern.Matches ("MDCLXVI", firstRoman))
Try "[MDCLXVI] *" and see if it's better
{
System.out.Print ("a valid Roman Number please try again");
firstRoman = firstRoman.toUpperCase ();
}My Code is as follows:
// Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase();
Once they enter in the it, I want to check to make sure that it has characters MDCLXVI and if it contains any other characters then I will provide a new object Scanner keyboard to try again and if it fails again, it will go to the option to try again until they put in a string that contains only the characters above. I don't know where to go here to get the while loop has worked. New to Java and I got my program work properly when I put good known numbers of novel, but I want to take incorrect entries.
Any help would be appreciated.
Thank you
WallyI put the code for my main program and my class below just in case. I have already met the requirements of the teacher if the project is done, I'm just trying to improve.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; import java.util.Scanner; import java.util.regex.Pattern; /** * * @author wsteadma */ public class mynameProject6 { /** * @param args the command line arguments */ public static void main(String[] args) { // Used for testing String firstRoman; String secondRoman; Scanner keyboard = new Scanner(System.in); // Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase(); // Ask for user to input secondRoman Number System.out.print("Enter your second Roman Number:"); // add the Roman Number to the String variable secondRoman = keyboard.nextLine(); // Add the name input into the name variable secondRoman = secondRoman.toUpperCase(); //Creating first instance of Roman Numbers class Roman firstNumber = new Roman(firstRoman); Roman secondNumber = new Roman(secondRoman); System.out.println("Printout of the created roman numbers"); //Prints out the Roman Number firstNumber.printRoman(); secondNumber.printRoman(); // Convert Roman to Decimal firstNumber.setDecimal(firstRoman); secondNumber.setDecimal(secondRoman); System.out.println("Viewing the Decimal values for the two defined instances"); //Prints decimal Numbers firstNumber.printDecimal(); secondNumber.printDecimal(); System.out.println("Adding the Roman Numbers and returning new Roman value"); Roman romanAdd; romanAdd = firstNumber.addRoman(secondNumber); romanAdd.printRoman(); System.out.println("Subtracting the Roman Numbers and return new Roman value"); Roman romanSub; romanSub = firstNumber.subRoman(secondNumber); romanSub.printRoman(); } }
CLASS:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; /** * * @author wsteadma */ public class Roman { private String romNumber; private int decNumber; public Roman(String rNumber) { romNumber = rNumber; } public String getRoman() { return romNumber; } public int getDecimal() { return decNumber; } public void printRoman() { System.out.println("The Roman Number is " + romNumber); } public void printDecimal() { System.out.println("The Decimal Number is " + decNumber); } // Converts a roman number string into a decimal value public int setDecimal(String romNum) { int charValue = 0; char[] characters = new char[romNum.length()]; //System.out.println("romNum length is " + romNum.length()); for (int counter = 0; counter < romNum.length(); counter++) { characters[counter] = romNum.charAt(counter); //System.out.println(characters[counter]); } for (int sCounter = 0; sCounter < romNum.length(); sCounter++) { if (characters[sCounter] == 'M' || characters[sCounter] == 'm') { charValue += 1000; } else if (characters[sCounter] == 'D' || characters[sCounter] == 'd') { charValue += 500; } else if (characters[sCounter] == 'C' || characters[sCounter] == 'c') { charValue += 100; } else if (characters[sCounter] == 'L' || characters[sCounter] == 'l') { charValue += 50; } else if (characters[sCounter] == 'X' || characters[sCounter] == 'x') { charValue += 10; } else if (characters[sCounter] == 'V' || characters[sCounter] == 'v') { charValue += 5; } else if (characters[sCounter] == 'I' || characters[sCounter] == 'i') { charValue += 1; } } decNumber = charValue; return charValue; } // Converts a decomal number to a roman number public String setDec2Roman(int decNum) { String newRoman = ""; while (decNum >= 1000) { newRoman += "M"; decNum -= 1000; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 500) { newRoman += "D"; decNum -= 500; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 100) { newRoman += "C"; decNum -= 100; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 50) { newRoman += "L"; decNum -= 50; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 10) { newRoman += "X"; decNum -= 10; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 5) { newRoman += "V"; decNum -= 5; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum > 0) { newRoman += "I"; decNum -= 1; //System.out.println(decNum); //System.out.println(newRoman); } return newRoman; } public Roman addRoman(Roman newRom) { int totRom = newRom.setDecimal(newRom.romNumber) + decNumber; romNumber = newRom.setDec2Roman(totRom); return new Roman(romNumber); } public Roman subRoman(Roman subRom) { int totRom = decNumber - subRom.setDecimal(subRom.romNumber); romNumber = subRom.setDec2Roman(totRom); return new Roman(romNumber); } }
-
How to activate a button only when an item of component tilelist is selected
Simple question, but it seems quite difficult for me. How to activate a button only when an item in a tilelist currently selected?
For example, lets say if I have a button named button1, which is disabled by default and a tilelist component called tilelist1 that I should add in brackets the following (the enabled property of the button) code to make sure that the button is only enabled when an item in the tilelist component is currently selected but disabled when no item is selected :-
enabled = "{}".
Enabled = "{tilelist1. SelectedItem} ".
that should do it, it is making an implicit comparison with null (tilelist1.selectedItem == null) which will result in a Boolean value.
SelectedItem is null when nothing is selected, non-null when something is.
-
Hi all
How to choose the value of a string are letters (for example, TEST) and all numeric...
for example
TEST 123456
TEST 34567
123456 ABCD
1234 TEST
TESTING 12345
TEST 1@234$
YOUR T 123456I want the results of the query as below.
TEST 123456
TEST 34567And I tried to use regexp_like in this case but without success. See the code below.
SELECT * FROM TABLE WHERE regexp_like (Description, ' [TEST] % & [[: digit:]] + $');How can I do this, please answer.
Thank you
WF
If you want to return only the rows that contain the string 'TEST', followed by zero or more space characters, followed by one or more digits?
How about this:
SELECT *.
FROM my_table
WHERE REGEXP_LIKE(description,'^TEST\s*\d+$')
-
How to select the library item (Code)
I want to play a part of the scene - and when it's done, add another symbol from the library (on stage and play / delete the one that was on the scene)
Problem is that I don't know how to select items in the library. I tried
all the var = sym. $('*');
Console.log (SYM, All);
but he selects only the elements of the scene.
Thank you!
You must use
sym.createChildSymbol ('libraryitemname', 'Stage');
Then, you have to use css to place them on the stage.
example:
redBox var = sym.createChildSymbol ('redBox', 'Stage');
redBox.element.css ({"top": 50, 'left': 350});
or in a container:
redBox var = sym.createChildSymbol ('redBox', 'container');
example: https://app.box.com/s/wawh6efg25b701htahjj
Check out my blog here: http://www.edgehero.com/tutorials/scope
-
How to select all the values populated both of LOV
Hi all.
I developed a form containing fields in a table. I join these areas a LOV (which get values in the other table). Now, I have to select a value only once for each record.
But my question is how to map all the LOV values to these fields at a time. If it is possible what exactly is the way.
If this is not possible then what is the way to do that.
Thanks in advanceHello!
Try using this code.
You will get a lot of messages, but you can discover what column could not be red:declare l_group recordgroup := find_group ( 'lov27' ); l_result pls_integer; begin if show_lov --> show the lov and user selected a value then l_result := populate_group ( l_group ); clear_record; for i in 1..get_group_row_count ( l_group ) loop message ( 'reading personal no' ); :bill_detail.personal_no := get_group_char_cell ( 'lov27.personal_no', i ); message ( 'reading name' ); :bill_detail.name := get_group_char_cell ( 'lov27.name', i ); message ( 'reading desigantion' ); :bill_detail.designation := get_group_char_cell ( 'lov27.designation', i ); message ( 'reading rank' ); :bill_detail.rank := get_group_char_cell ( 'lov27.rank', i ); message ( 'reading basic scale' ); :bill_detail.basic_scale := get_group_number_cell ( 'lov27.basic_scale', i ); message ( 'reading basic pay' ); :bill_detail.basic_pay := get_group_number_cell ( 'lov27.basic_pay', i ); message ( 'reading basic pay' ); :bill_detail.vendor_no := get_group_number_cell ( 'lov27.vendor_no', i ); message ( 'reading branch code' ); :bill_detail.branch_code := get_group_number_cell ( 'lov27.branch_code', i ); message ( 'reading sr no' ); :bill_detail.sr_no := get_group_number_cell ( 'lov27.sr_no', i ); create_record; end loop; first_record; end if; end;
-
Printer all in one HP3520 - how to select the wireless network and enter the WEP key?
According to print my wireless network is detected.
How to connect the! @# % printer $ fo the wireless network and enter the WEP key?
Instructions on the HP site tell me to selet NETWORK on the printer control panel. Well, there's a way to select the NETWORK from the control panel. It is not an option for him.
I downnloaded and installed the latest drivers.
I have restored the default settings.
How to select the wireless network and enter the WEP key?
All of HP's instructions seem to be for a newer printer with a touchscreen.
I want that the printer is connected to my main computer via the USB port. I want to be able to print wireless phones and tablets.
My 3520 is not a 'touch Screen' and it has wifi.
However, the following work:
Try to open the HP Deskjet 3520 icon, open the utilities tab, click on convert USB wireless, by following the steps on the screen.
This leads me to believe that ONLY the wireless doesn't work. I know now that the part of the sentence "Convert USB to wireless connection" is supposed to mean "works like USB and wireless.
Thank you for your help
-
How to change the background color of string programmatically?
How to change the background color of string programmatically?
Are you talking about string indicator and control chain? If so, right-click on a control/indicator of string and select Create-> property Node-> text-> text-> BG Color colors. Change to write and a number of the color you want to use phone.
-
HP Officejet 6600
How to print in black only.
the printing interface is very poor.
I replaced a Canon printer, and printing options are clear.
I think back for a Canon printer!
To print the black ink only follow the steps below.
1. Select Start menu
2. go into devices and printers.
3. right click on the printer, select printing preferences
4. in the lower right corner, select Advanced
5. and then under features of the printer select print grayscale a dropdown list will appear to black ink only.Let me know how it goes.
-
How to select a 14 days ago restore point?
How to select a 14 days ago restore point? It will only return 5 days when providing a list of restore points to choose.
If you checked the box to display the points of restoration more than 5 days, then I'm afraid you're out of luck.
http://bertk.MVPs.org/html/restoresysv.html
Excerpt from Microsoft help
"Restore points are saved until the disk space, System Restore reserves is filled." As new restore points are created, old ones are deleted. »
Maybe you are looking for
-
Hello I'm trying to make a loop similar to the text following c (for i = 32, i + 2) Please tell me if it is possible to increment in Labview by more than 1 in a loop, and on the other hand if I can start the loop to another number, with the exception
-
updated same guard installation
the next update keep appearing as the yellow shield and guard installed successfully! Install Microsoft.NET Framework 1.1 service pack 1. update security for windows 2000, xp, vista, server 2008, windows 7 and windows 2008 R2 (KB953297) Server 2 mo
-
What cable/device can I use to connect my USB only all-in-one 200xt to my HD TV?
Is there a USB cable to HDMI that would do this?
-
Hyper V in vFoglight, how to add
HI friends, Was just born to these new Foglight community, I installed vfoglight, especially for monitoring of Hyper v virtual machine infrastructure I tried to configure my Hyper V environment, but unsuccessful can some please guide me how to config
-
BB::Cascades:KeyLayout and TextArea
Hello I need help on how to edit TextArea and KeyLayout in alphanumeric mode. It is the property of entry (bb::cascades:TextInputProperties), but it doesn't have the property of KeyLayout. I tried to change to C++ and Qml, but this property seems to