How do you sort a text field with numeric data in numeric order
We have a text field (varchar2) that has numeric data. When we sort it the items display as
1
2
3
4
5
6
7
8
9
10
*101*
12
Instead of
1
2
3
4
5
6
7
8
9
10
12
101
How can I make it display in numeric order if the field is a varchar2
Howard
To avoid string-to-number conversion:
SQL> with t as (
2 select '1' a from dual union
3 select '2' a from dual union
4 select '3' a from dual union
5 select '4' a from dual union
6 select '5' a from dual union
7 select '6' a from dual union
8 select '7' a from dual union
9 select '8' a from dual union
10 select '9' a from dual union
11 select '10' a from dual union
12 select '101' a from dual union
13 select '12' a from dual)
14 select a from t
15 order by length(a), a;
A
1
2
3
4
5
6
7
8
9
10
12
101
12 rows selected.Max
http://oracleitalia.wordpress.com
Similar Messages
-
How to create Using Formatted Text Field with multiple Sliders?
Hi i found the Java Sun tutorial at http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html very useful, and it tells how to create one Formatted Text Field with a Slider - however i need to create Formatted Text Field for multiple Sliders in one GUI, how do i do this?
my code now is as follows, and the way it is now is scroll first slider is okay but scrolling second slider also changes value of text field of first slider! homework due tomorrow, please kindly help!
// constructor
label1 = new JLabel( "Individuals" );
scroller1 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 10 );
scroller1.setMajorTickSpacing( 10 );
scroller1.setMinorTickSpacing( 1 );
scroller1.setPaintTicks( true );
scroller1.setPaintLabels( true );
scroller1.addChangeListener(this);
java.text.NumberFormat numberFormat = java.text.NumberFormat.getIntegerInstance();
NumberFormatter formatter = new NumberFormatter(numberFormat);
formatter.setMinimum(new Integer(0));
formatter.setMaximum(new Integer(100));
textField1 = new JFormattedTextField(formatter);
textField1.setValue(new Integer(10)); //FPS_INIT
textField1.setColumns(1); //get some space
textField1.addPropertyChangeListener(this);
//React when the user presses Enter.
textField1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
textField1.getActionMap().put("check", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!textField1.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField1.selectAll();
} else try { //The text is valid,
textField1.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
label2 = new JLabel( "Precision" );
scroller2 = new JSlider( SwingConstants.HORIZONTAL, 0, 100, 8 );
scroller2.setMajorTickSpacing( 10 );
scroller2.setMinorTickSpacing( 1 );
scroller2.setPaintTicks( true );
scroller2.setPaintLabels( true );
scroller2.addChangeListener(this);
textField2 = new JFormattedTextField(formatter);
textField2.setValue(new Integer(10)); //FPS_INIT
textField2.setColumns(1); //get some space
textField2.addPropertyChangeListener(this);
//React when the user presses Enter.
textField2.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
textField2.getActionMap().put("check", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!textField2.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField2.selectAll();
} else try { //The text is valid,
textField2.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
// State Changed
public void stateChanged(ChangeEvent e) {
JSlider source = (JSlider)e.getSource();
int fps = (int)source.getValue();
if (!source.getValueIsAdjusting()) { //done adjusting
if(source==scroller1) {
System.out.println("source ==scoller1\n");
textField1.setValue(new Integer(fps)); //update ftf value
else if(source==scroller2) {
System.out.println("source ==scoller2\n");
textField2.setValue(new Integer(fps)); //update ftf value
} else { //value is adjusting; just set the text
if(source==scroller1) textField1.setText(String.valueOf(fps));
else if(source==scroller2) textField2.setText(String.valueOf(fps));
// Property Change
public void propertyChange(PropertyChangeEvent e) {
if ("value".equals(e.getPropertyName())) {
Number value = (Number)e.getNewValue();
if (scroller1 != null && value != null) {
scroller1.setValue(value.intValue());
else if (scroller2 != null && value != null) {
scroller2.setValue(value.intValue());
// ACTION PERFORMED
public void actionPerformed(ActionEvent event) {
if (!textField1.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField1.selectAll();
} else try { //The text is valid,
textField1.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
if (!textField2.isEditValid()) { //The text is invalid.
Toolkit.getDefaultToolkit().beep();
textField2.selectAll();
} else try { //The text is valid,
textField2.commitEdit(); //so use it.
} catch (java.text.ParseException exc) { }
...if :p3_note_id is null
then
insert into notes (project_id, note, notes_month, notes_year) So, p3_note_id is NULL.
Another option is that you have a trigger on table NOTES that generates a new note_id even for an update. -
How do you forward a text message with pictures to another mobile user
How do you forward a text message with pictures to another mobile device?
Howdy Greg,
It sounds like you have some texts with images attached you would like to forward to another device. If the it can receive text messages, use these steps:
Send messages with your iPhone, iPad, or iPod touch
How do I forward a message?
To forward a message, tap and hold the message bubble, then tap More.
Tap to select the message you want to forward, then tap and select the person to send it to.
If the receiving device does not have the ability to receive text messages, you can also email them to an account setup on it by first saving the message to your phone:
How do I save a photo from a message?
Tap the photo, then tap .
Then emailing it to an account setup on the device from the Photos app:
Other ways to share photos and videos - iPhone
Save or share a photo or video you receive.
Email: Tap to download it if necessary, then touch and hold the item to see sharing and other options.
Thank you for using Apple Support Communities.
Regards,
Sterling -
How do you take off text field
How do you take off text field
Hi again, sounds like you accidently hey CMD+F5 & turned on Voice Over, try CMD+F5 again, or see this...
I think the issue is caused by the Apple Voiceover Utility. Part of its function for the visually impaired is to highlight the button or text item that it is going to speak. i suggest you turn off Voice over either going to System Preferences -> Universal Access and Making sure that voiceover is turned off. Alternatively press Apple(Command) F5 to turn it on & off. The black rectangles should go away. If you want voiceover but not the black rectangles. You can open the voice over utility and change the settings to the text is still spoken but without the highlighting.
https://discussions.apple.com/message/5786829#5786829 -
How to autopopulate a text field with unique data from multiple data sets
Hi,
I'm a laboratory manager in charge of a hospital project which will be using pdf forms to send and receive data from our end users across the city. I need help with the last part of our pdf form, specifically with a js that will do a bit of text-field autopopulation magic. This, unfortunately, is a beyond what I have taught myself about pdf js functionality.a
The problem:
I need to provide my end users with a text field containing a set of data [A, B, C, D, E, F ...] and the total items in this set [tot#]. The end user needs this information as part of the implementation of this particular laboratory machine.
The particulars
When the end user asks for an experiment to be run, we must specify some pieces of data to help them interpret the results. These are constructed as panels which contain discrete data elements.
For example - One experiment may use two panels, Panel#1 and Panel #2. Panel #1 includes the items A, B, D, E, Panel #2 includes the items A, B, C, F, G.
Thus, the panels may share some of the same items, but, I only want the unique members to be displayed in the text field. If I make a drop down box or checkboxes with the panels, I want to be able to select the panels that we ran and (in this example) have the text field display only the unique items among all the panels that were used:
textfield outpute = A, B, C, D, E, F, G - 7 total.
Any assistance from the pdf community would be very much appreciated.
Thanks!Thanks for that help.
I should have made it more apparent that I'm very new to scripting and I'm
not a programmer by trade. I have a few questions before modifying the code
you kindly provided.
1) Where should I embed this script? Within the 'selection change' area of
my listbox?
2) Can I replace the term 'arr' with the names of the various items in my
listbox or should I put 'arr#' as the output value for each term?
3) Will this script find and display the unique values when a user selects
multiple items in my listbox?
4) How does the script know where to output the unique members of the
combined set?
I appreciate your patience with me.
ck -
Can you scroll multiple text fields with 1 UIscrollbar component?
I have been poking around on the internet trying to find out a way to do this on flash using AS2.0 but have had no luck. Is it even possible?!
or is there another way of achieving a similar affect?
I have XML data being pulled from an array of attributes that get listed in there own text field or column basically.
Attribute1(text1)
Attribute2(text2)
Attribute3(text3)
item1
item2
item3
item4
location1
location2
location3
location4
date1
date2
date3
date4
Above is how the data gets displayed in the 3 different text boxes... each item is associated to a location and a date and i need to be able to scroll down through the items but have the locations and dates stay inline with the specific item.
Any suggestions would be great!
Thanks in advance.i don't have a clue about the XML (I'm still in embryo stage on that one at one-half a tutorial) BUT,
to connect without commas, you can do something like this. My array name was aHiragana (japanese letters)
var sHiragana:String = aHiragana.join(""); //kills the comma
words.text = sHiragana.toString(); //works, note "s" not "a" infront of Hiragana.
no idea if this is compatible with XML. -
How do you load in text styles with add-in persistent interfaces?
Hello,
I've added in a persistent interface to the kStyleBoss which gives paragraph styles and character styles some added meta data. They are not text attributes, but rather attributes or options for the style itself, kind of like the name of the style is.
Unfortunately, when styles that have these option settings are loaded from one InDesign document to another, the settings do not come through. I guess kLoadStyleCmdBoss is not aware of the persistant interface I've added to the kStyleBosses and so does not copy them across. Does anyone have any idea how to modify kLoadStyleCmdBoss so it will replicate the data in the persistant interface I've added in? Do I need to modify kCreateParaStyleCmdBoss or kCreateCharStyleCmdBoss in anyway as well?
Best regards,
John HopkinsHi,
Well, previous link (Adobe TV) is deprecated.
Here is an updated and upgraded tuto: Chris Gannon blog.
Therefore, assuming you are using Edge 5.0 (EA CC 2014.1.1), you have 2 solutions:
1) The XMLHttpRequest API.
2) $.AJAX() if and only if you load a jQuery file: library panel > scripts. -
How to set "Display as Text" field with AJAX select list
thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
here is the code from the url above
1. Create an Application Process - getDet:
DECLARE
my_det VARCHAR2 (200);
BEGIN
SELECT ename || CHR(10) || job || CHR(10) || mgr
INTO my_det
FROM emp
WHERE empno = :P80_EMPLOYEES;
HTP.prn (my_det);
END;
2. Put the following in the Region Header of your page:
<script language="JavaScript" type="text/javascript">
function f_getDet ()
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
gReturn = get.get();
if(gReturn)
{ html_GetElement('P80_DETAILS').value = gReturn }
else
{ html_GetElement('P80_DETAILS').value = 'null' }
get = null;
</script>
3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
onChange="f_getDet()";Arie,
this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
Thanks,
Surya
<script language="JavaScript" type="text/javascript">
function setDisplayOnlyNode(pItem, pValue)
{ var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
function f_getDet ()
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
gReturn = get.get();
if(gReturn)
{ setDisplayOnlyNode('P1_DETAILS',gReturn)}
{ html_GetElement('P1_TEST').value = gReturn }
get = null;
</script> -
Update text fields with xml data based on DDL selection of an ID number
Hi guys,
this one should be straight forward, but I cant seem to find a straight forward answer. In a nutshell:
XML file contains ID, Name, Location (so far 3 records in sample xml file)
Form contains a Dynamic Drop down list to allow selection of ID and text fields to display the associated name and location of that ID. The binding of the Drop down works fine, however I need the other fields to update to the associated name and location when different ID's are selected. I assume I'll need some sort of exit event on the drop down list to update the other fields with the Name and location of the ID selected, but I dont know enough to have a stab at it.
please, please, please help, Im starting to pull my hair out.
James.Hi James,
This would depend on the structure of your XML but assuming you have something like;
<Data>
<Item>
<Id>1</Id>
<Name>Name1</Name>
<Location>Location1</Location>
</Item>
<Item>
<Id>2</Id>
<Name>Name2</Name>
<Location>Location2</Location>
</Item>
<Item>
<Id>3</Id>
<Name>Name3</Name>
<Location>Location3</Location>
</Item>
</Data>
Then in the change event of your dropdown (your could use the exit event but then value might not have changed so would be performing unnecessary processing) add the following code.
var itemGroup = $data.Data.resolveNode("Item.(Id.value === '"+xfa.event.change+"')");
Name.rawValue = itemGroup.Name.value;
Location.rawValue = itemGroup.Location.value;
The xfa.event.change will be the value selected, the resolveNode will return the Item with the matching Id, and then it is just a matter of assigning it to your form fields.
Hope this gets you started.
Regards
Bruce -
How can you create a text field without a label?
I am creating a form and need to create identical text boxes one below another and for space reasons do not want a label on each one. How do I do this without selecting multiple fields?
Sorry you can't remove the label of a field. When the Label is on the Left (either left aligned or right aligned) then you can resize the label (using drag and drop) but there is still a min width that the label must have. You can also change the Label to be Above but that might not work with your spacing either.
Gen -
How do you clear an InputText field with a button click
I am trying to create a calculator and I want to be able to use a "Clear" button that will reset all the values entered in several InputText fields and the total which is a label. I can update and clear a label using the UpdateContext
function, but this isn't working for an InputText field. Can someone provide an example on how to clear one InputText field?Hello,
To do this you need to do the following
Add an "Input Text", select the inputText and click Express view (bottom right).
Set the default value to
textboxvalue
without any quotes
On the behaviour / OnVisible of screen you put the inputText on set for example the following
UpdateContext({textboxvalue: "Enter text here"})
You can now add several buttons on the screen that do something
UpdateContext({textboxvalue: ""})
or
UpdateContext({textboxvalue: "Enter Text here"})
Or you could chain it with another OnSelect that is going on on the screen and reset your textbox. You can then also add the value the user has entered in a collection too (see bottom example)
Navigate(Screen2, ScreenTransition!Fade);UpdateContext({textboxvalue: "Enter Text here"})
Collect(inputcollection,{userinput: InputText1!Text});Navigate(Screen2, ScreenTransition!Fade);UpdateContext({textboxvalue: "Enter Text here"})
I believe this should point you in the right direction
Regards
StonyArc -
When opening the Bookmarks Sidebar, the oldest bookmarks added are at the very top, easily visible.
The most recent bookmarks added are at the bottom, requiring me to scroll all the way down every time I want to visit a recent bookmark. This is a major nuisance. I'm actually a little shocked that this happens when it's such an obvious hassle.
How can I flip the list of bookmarks so the newest ones are right at the top where I can easily access them?
Sorting in the Library does not carry over to the Sidebar as far as I can tell.Looks as though the SortPlaces add-on should be able to do it.
Similar thread: [http://support.mozilla.com/fur/questions/771606 I would like to find a way to save my bookmarks unsorted but with the newest saves at the top of the list. I don't want alphabetical order. 3.6.13 | Firefox Support Forum | Firefox Help]
Add-on: [https://addons.mozilla.org/en-US/firefox/addon/sortplaces/ SortPlaces :: Add-ons for Firefox] -
How do you set up Paged View with Spry Data Sets
Hope someone can help. I have constructed a Spry data set using a html table and want to use the paged view javascript to limit the amount of rows displayed on one page at a time to 10 then forcing a new page. Have found the java script file in the spry 1.6 download and attached it to the spry assets folder and have followed the instructions found at the Adobe development center http://labs.adobe.com/technologies/spry/articles/pager/index.html with no luck. Have attached files to show what I have done. If someone could look at this and point out my error or suggest a better way I would be grateful. I am not a code warrior so simple instructions would be so helpful. Many thanks in advance.
Here is the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
<script src="SpryAssets/SpryPagedView .js"></script>
<link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.HTMLDataSet("table.html", "ds1", {sortOnLoad: "Name", sortOrderOnLoad: "ascending"});
ds1.setColumnType("Phone", "number");
var pv1 = new Spry.Data.PagedView( ds1 ,{pageSize: 10});
//-->
</script>
</head>
<body>
<input type="button" value="First" onclick="pv1.firstPage();" />
<input type="button" value="Prev" onclick="pv1.previousPage();" />
<input type="button" value="Next" onclick="pv1.nextPage();" />
<input type="button" value="Last" onclick="pv1.lastPage();" /
<div class="MasterDetail">
<div spry:region="ds1" class="MasterContainer">
<div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{Name}</div>
</div>
<div spry:detailregion="ds1" class="DetailContainer">
<div class="DetailColumn">{Name}</div>
<div class="DetailColumn">{Product}</div>
<div class="DetailColumn">{Contact}</div>
<div class="DetailColumn">{Phone}</div>
</div>
<br style="clear:both" />
</div>
<input type="button" value="First" onclick="pv1.firstPage();" />
<input type="button" value="Prev" onclick="pv1.previousPage();" />
<input type="button" value="Next" onclick="pv1.nextPage();" />
<input type="button" value="Last" onclick="pv1.lastPage();" /
</body>
</html>Your region needs to refer to the pageview, not the dataset. Your paged view var is already looking at/pulling in the ds.
I would change the following code:
<div spry:detailregion="ds1" class="DetailContainer">
<div class="DetailColumn">{Name}</div>
<div class="DetailColumn">{Product}</div>
<div class="DetailColumn">{Contact}</div>
<div class="DetailColumn">{Phone}</div>
</div>
to read the following:
<div spry:region="pv1">
<table>
<tr spry:repeat="pv1">
<td>{Name}</td>
<td>{Product}</td>
<td>{Contact}</td>
<td>{Phone}</td>
</tr>
</table>
Regards,
Michael -
I have a virus which may mean I will have to wipe my HD and re-install software.
I am concerned about losing data and settings when I re-install LR5.
Is everything recoverable through the LR catalogue?So who do I believe?
Blog: http://www.jamoroki.com
James King
about.me/jamoroki
<http://about.me/jamoroki> -
Is there a fax cover template? If not, how can I have 2 text fields on one line?
Is there a fax cover template? If not, how do you add two text fields on one line?
No fax cover template. This forum posts explains how to put multiple fields on one line:
http://forums.adobe.com/message/5032849
Maybe you are looking for
-
I can't open iTunes on iPhone 5 with iOS7, what's up?
I can't open iTunes on iPhone 5 with iOS7, what's up?
-
InCopy/InDesign CS3 Assignment Problem
Hello everyone-- For the past three years we've used Version Cue CS3 for workflow on our publication. For the most part its worked fine. Recently though, we've had to get a new computer for an office on the West Coast and a new router on our office
-
Is it possible to create a new Grid in the same analysis where calculated/Grand Totals columns/rows may be used? I understand there is a feature use results from another analysis but wonder if it can be used in the same. Thanks. Adi
-
How do I tell if I have Wireless N support.
I bought a MacBook in roughly October of 2006. I was wondering how to tell if the wireless that I have supports wireless N before I buy the unlocker for it. I checked in the Network utility and it doesn't list 'N' in the designation but I thought tha
-
Encounter problem when I'm using JTextArea
hi everyone: I have less experience on Swing development. Recently, I encounter a weird problem. I have a JTextArea component which it was populated on JInternalFrame, and when I try to switch an inputmethod(Actually is Chinese inputmethod). the appl