How to show the value of string with spaces in separate columns
Hi all, I am using Oracle 10 g.create table
create table sample_test (
Name VARCHAR2(20 BYTE))
Insert a tableinsert into sample_test values ('JOAN SCT')
insert into sample_test values ('MELIA FILCK')
insert into sample_test values ('SSAN LIER-LILEY')
insert into sample_test values ('C.M. DANY WES')
insert into sample_test values ('A L SCOTT')
Select * from sample_test;Name
JOAN SCT
MELIA FILCK
SSAN LIER-LILEY
C.M. DANY WES
A L SCOTT
I would like the following outputNAME1 NAME2 NAME3
JOAN SCT
MELIA FILCK
SSAN LIER-LILEY
C.M. DANY WES
A L SCOTT
whenever there is a space in the name of the value next to who should be included in another column. Please note the name joan has TBS of two spaces. but it must be treated as a single space.also is it possible to get something like that
NAME1 NAME2
JOAN SCT
MELIA FILCK
SSAN LIER-LILEY
C.M.DANY WES
A L SCOTT
the value before the first space on the right must be everything in domain Name1 Name2.Thanks in advance.
Hello
Since you have Oracle 10, you can use regular expressions:
For the release of 3 columns:
SELECT REGEXP_SUBSTR (name, '[^ ]+', 1, 1) AS name1
, REGEXP_SUBSTR (name, '[^ ]+', 1, 2) AS name2
, REGEXP_SUBSTR (name, '[^ ]+', 1, 3) AS name3
FROM sample_test;
[^ xyz] means "any character except x, y or z."
+ means "1 or more of the previous ones.
The 4th argument to REGEXP_SUBSTR indicates where we want the appearance of the model.
For the release of 2 columns:
SELECT REGEXP_REPLACE (name, ' *[^ ]+$') AS before_last_space
, REGEXP_SUBSTR (name, '[^ ]+$') AS after_last_space
FROM sample_test;
$ here means "the end of the string.
In Oracle 10, you will often use REGEXP_REPLACE to get substrings.
Thanks for posting the CREATE TABLE and INSERT statements; It's very useful!
Published by: Frank Kulash, 7 Sep 2011 15:21
Tags: Database
Similar Questions
-
Hello
Photoshop Elements 8, how to show the value, the hue and saturation of a specific area of the image?
How to choose the area? Which tool?
Thank you in advance, Karl
Make sure first that your range of information is visible: window menu / Info (shortcut F8)
In this palette, click the small icon 'more '.
Select "Palette Options".
and choose HSB to second reading of palette.
-
How to get the value of a particular tag to a column (clob)
Hi friends,
How to get the value of a particular tag to a column (clob), which has an XML value?
Thanks in advance.
Kind regards
Sirot ChauvetYou are welcome, if you got your answer to the question as such brand
-
new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture. No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.
Hi GerdW
Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases. Now I want to insert user event by changing the control and influential cases during run time.
As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well. But then, I found there are a lot of screws that are using the string unbundle. One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.
I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.
I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?
Mant thanks!
Minyi
-
How to show the loading (wait screen) with animated image dialog between the screens
Hello
Can anyone show how to insert the load between two screens dialog, while the second screen is taken
loading time?
I tried the examples given in the forum but no luck
There is an update about it here:
Note comment added to the article as well - this is a useful Variant.
-
How to show the value Color Picker (drawing area)
Hi all
How to make a Color Picker selection guide the user can see the selected color? In my example - the color selected by Color Picker must paint the place. All variants? Preferably with Dom.
var wColor= new Window('dialog', ' '); wColor.orientation = "column"; wColor.alignment="top"; wColor.spacing=0; wgr1=wColor.add('group'); wgr1.orientation = 'row'; wgr1.alignment='top'; btnRGB1= wgr1.add('button',undefined,'RGB'); btnRGB1.preferredSize = [50,20]; p1 = wgr1.add("panel", undefined, "", {borderStyle:"silver"}); p1.preferredSize = [22,22]; wgr2=wColor.add('group'); wgr2.orientation = 'row'; wgr2.alignment='top'; btnRGB2= wgr2.add('button',undefined,'RGB'); btnRGB2.preferredSize = [50,20]; p2 = wgr2.add("panel", undefined, "", {borderStyle:"silver"}); p2.preferredSize = [22,22]; btnRGB1.onClick = function(){//------------------------------------------------------- app.showColorPicker(); } btnRGB2.onClick = function(){//------------------------------------------------------- app.showColorPicker(); } wColor.show()
Try this:
#target photoshop
color1 = new SolidColor() var
var Color2 = new SolidColor()
var wColor = new window ("dialog", "");
wColor.orientation = "column";
wColor.alignment = "top";
wColor.spacing = 0;
wgr1 = wColor.Add ('group');
wgr1.orientation = "row";
wgr1. Alignment = 'top';
btnRGB1 = wgr1.add ('button', undefined, 'RGB');
btnRGB1.preferredSize = [50,20];
P1 = wgr1.add ("panel", undefined, "", {borderStyle: "money"});
P1. PreferredSize = [22,22];
wgr2 = wColor.Add ('group');
wgr2.orientation = "row";
wgr2. Alignment = 'top';
btnRGB2 = wgr2.add ('button', undefined, 'RGB');
btnRGB2.preferredSize = [50,20];
P2 = wgr2.add ("panel", undefined, "", {borderStyle: "money"});
P2. PreferredSize = [22,22];
btnRGB1.onClick = function() {/ /-}
app.showColorPicker ();
Color1. RGB. Red = app.foregroundColor.rgb.red
Color1. RGB. Green = app.foregroundColor.rgb.green
Color1. RGB. Blue = app.foregroundColor.rgb.blue
g = p1.graphics;
myBrush var = g.newBrush (g.BrushType.SOLID_COLOR, [color1.rgb.red/255,color1.rgb.green/255,color1.rgb.blue/255, 1]);
g.backgroundColor = myBrush;
try {App.foregroundColor = color1}
{catch (e)}
try {App.BackgroundColor = 2}
{catch (e)}
}
btnRGB2.onClick = function() {/ /-}
app.showColorPicker ();
color2. RGB. Red = app.foregroundColor.rgb.red
color2. RGB. Green = app.foregroundColor.rgb.green
color2. RGB. Blue = app.foregroundColor.rgb.blue
g = p2.graphics;
myBrush var = g.newBrush (g.BrushType.SOLID_COLOR, [color2.rgb.red/255,color2.rgb.green/255,color2.rgb.blue/255, 1]);
g.backgroundColor = myBrush;
try {App.foregroundColor = color1}
{catch (e)}
try {App.BackgroundColor = 2}
{catch (e)}
}
wColor.show)
-
How to connect the value of the input string to numeric values
Hello
I'm trying to figure out how to connect the value of unique user input string to numeric values. Basically I want the user to enter the name of a gas that I have a list for (I think I put the list of gases in a table >). Then I want to match numeric values 2 'a' and 'b', according to which gas, name of the user has set. These 'a' and 'b' values will be automatically matched with the name of the gas in a list that I put. For example, hydrogen gas has the value 3 for "a" and 4 for "b. when the user puts the ' hydrogen' name in a string constant, automatically 'a' and 'b' must be issued.» I have connect a and b to a formula
Thanks for any help
Hello
It is perhaps not exactly what you are looking for, but perhaps you could use the enumerated data type and the array of clusters of points (a, b).
Look at the VI I enclose.
-
Please show or ask how to create the value of arrayOfValues of setValuesAtTimes parameter?
Hello AEScriptComm,
I have a few small scripts that use the method setValueAtTime successfully placing a keyframe on the existing layers of maskPath, but as you can see in the scripts below, results of setValueSatTimeS errors using IE: "Array is not of the correct type", "value is not an array" or "Null is not an object", depending on ,...
(A) what variable is used as the value of parameter IE:
.maskPath;
. maskPath.value;
. maskPath.value.vertices
(B) what kind of table is used as the parameter value as in:
var addTheseKeys = new Array ((1,2,3,4); (as a parameter of the time)...
(with either)
var keyValues = new Array([10,10],[100,100],[15,50],[100,120]); ...." ]) "
(GOLD)
var keyValues = [[10.10], [100 100], [15.50], [100 120]]; ... (Array of arrays? RE: " ]] " )
I just read a 'push' of the values in a table may be necessary?, but I was hoping someone who knew setValuesAtTimes could show it please...
1) .. How to create the value of arrayOfValues of setValuesAtTimes parameter?
1 (a): WORK setValueAtTime script...
App.Project.Item (1) .layer (1).property("Masks").property ("mask 1");
var app.project.item = myProperty (1) .layer (1) .mask (1) .maskPath;
myShape = app.project.item (1) .layer (1) .mask (1).maskPath.value;
myProperty.setValueAtTime(1.0,myShape);
1 (b): If there is no script setValuesAtTimes...
prop1 = app.project.item var (1) .layer (1).property("ADBE_Transform_Group").property ("ADBE Position");
var fourKeys = 4;
var addTheseKeys = new Array (1,2,3,4),
var keyValues = new Array (10, [10], [100 100], [15.50], [100 120]);
var app.project.item = myProperty (1) .layer (1) .mask (1) .maskPath;
myShape = app.project.item (1) .layer (1) .mask (1).maskPath.value;
var myVertices = app.project.item (1) .layer (1) .mask (1).maskPath.vertices;
myProperty.setValuesAtTimes (keyValues, addTheseKeys);
app.beginUndoGroup ("Keys");
~ for (var k = 0; k < fourKeys; k ++)
//~ {
~ prop1.setValueAtTime (keyValues [k], addTheseKeys [k]);
//~ }
myProperty.setValuesAtTimes (keyValues, addTheseKeys);
app.endUndoGroup ();
.. Thanks for any advise\suggestions,
J
(A). maskPath.value; It's always a Shape(). (maskPath is a property, not of a shape on its own, and maskPath.value.vertices is only a part of the shape data).
(B) nothing of what you propose... that is why your failed script fails.
var keyValues = new Array([10,10],[100,100],[15,50],[100,120]); and
var keyValues = [[10.10], [100 100], [15.50], [100 120]]; are just as good as arrays of points, the only thing is that keyValues are arrays of objects Shape().
Read the guide and script for how to report a form of this post (just wrote it...): http://forums.adobe.com/thread/1419866?tstart=0
Your keyValues array should look like this: [keyValues0, keyValues1, keyValues2, keyValues3], where each entry is a Shape().
Xavier.
-
How to send the value of the prompt to an another dashboard with action link?
Dear all,
I find how to send the parameter to a different dashboard with the link of the action.
URL = http://hostname/analytics/saw.dll?Dashboard & PortalPath = % 2Fusers % 2Fweblogic % 2FMartin % 20Test % 2FMartin & Page = page 1 & Action = Browse & P0 = 1 & P1 = eq & P2 = entity. "" Gen6, entity ' & P3 = % 22EntityCode % 22
But I don't know how to send the value of the command prompt. I tried @{EntityCode}, Entity.Gen6, Entity, etc. None of them worked. They just be send as a string.
Anyone know the solution? Thank you.
Best regards
MartinTry to do a manual URL to see if it works. Static variables are called as Valueof (variable) and presentation of variables such as @{variable}
Discover th url below and add your variables as needed and of course override other settings. -
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 assign a value of string comman separated in the Clause of SELECT m
In table A, I followed values
Price ID
-- ------
1 100
2,200
3 300
4 400
6 500
Now, in table B, I have following values
Product price combi
--------- ----- --------
OIL 600 '1', ' 2 ', 3'
What I do is, first of all get the combi in table B value and then get the count of the table has.
In condition, it should return 3...
create or replace procedure amit_combi_test
as
v_combi varchar2 (100);
tot_row number (10);
cursor table_combi is
Select combi
b;
BEGIN
OPEN table_combi.
LOOP
EXTRACT the table_combi in v_combi;
EXIT WHEN table_combi % NOTFOUND;
dbms_output.put_line (v_combi);
Select count (1) INTO tot_row
a.
WHERE ID in (v_combi);
dbms_output.put_line (to_char (tot_row));
END LOOP;
CLOSE Table_combi;
END;
But the problem is... it shows the value of the variable tot_row = 0; It should come 3...ace_friends22 wrote:
Thank you all, but it seems regexp_ functions and xmltable are not available in Oracle 9.2... I tried to use it, but it says invalid identifier......So why it is always a good idea to display the version of your database with your question, especially if you use a version not supported by the database, otherwise we have to assume that you use one of the latest versions supported. This saves also we are wasting our time.
-
How to get the value with DBSequence in EL links
Hello
I have a DBSequence type id and check if the value is null or positive
#{bindings. Id.inputValue! = null and links. Id.inputValue > 0? {"Edit": "Create"} does not work because the links. Id.inputValue returns a DBSequence and cannot convert Long
How to get the value?
JDev 11.1.1.6
You can try this:
#{bindings. Id.inputValue.sequenceNumber.value! = null and links. Id.inputValue.sequenceNumber.value > 0? {'Edit': 'Create'}
Jean Lou
-
How to remove the value of the XML attribute in the Indesign file with javascript
Hi all
How to remove the value of the XML attribute in the Indesign file.
What error is this?
in any case try this as well (one another),
var myDoc = app.activeDocument; attrDelete(myDoc); function attrDelete(elm) { for (var i = 0; i < elm.xmlElements.length; i++) { try{ for(j=0; j
Vandy
-
How to show a value of 0 for the null value
Hi all
How to see the value of zero (0) in the values column zero in pivot mode? Help, please
Thanks in advance.Hi Lisa,
In the criteria of the tab-> data-> number Format column properties treat as (choose: custom) and custom digital format write this: #, # 0;-#, # 0; 0
Best regards
Dana -
Why can't I just show the value of the reference variable on name full column
Hello everyone,
I want to display the value of the reference variable as column name for one of my analysis on OBIEE. However, when I write, it does not show the value, it shows just as text;
VALUEOF ("rv_yesterday")
How can I show the value of it?
Can you help me please.
Kind regards
Dilek
Raja,
What is a date or a related data type in any variable of RPD - session or repository - will become a datetime. That's a given and you can play as much as you want with to_date, trunc, DATE (the way of the RPD), but will it be a datetime value. Period.
Only when she is cast to a string rather than one of the 'date' data types can get rid of the component "hour".
Edit: Sorry, I forgot to add: < dilek,="" that="" response="" is="" your="" answer="" as="" well,="" sorry.="" no="" "date="" without="" time="" component="" in="" proper="" data="" types."=""> >
Maybe you are looking for
-
line of t440s on the touch screen of Windows 8
When I move my finger on the touch screen on my new T440s Windows 8 machine, a thin dark line about an inch long follows my finger - as much as I move it. Someone at - it ideas?
-
Original title: possible hacker... Ok.. I been having problems with my computer since this John guy Dave was writing me on a powerball scam and I scored that him and I notice that his name was on my cookie settings and I had problems with my down
-
The fingerprint sensor does not work
Hello, I have reset windows on my laptop and the fingerprint sensor does not work, windows recognize the sensor, but in the Device Manager, windows says there is a problem with the sensor, "this device does not work properly because Windows cannot lo
-
Windows media player no video but thers is sound
I have a lot of movies on an external hard drive, but I can't watch it, there is sound but no video.
-
Songs disappeared all of a sudden
Hi, I have this weird problem where the "rocket" froze on a song and all the songs in the internal memory stopped then appear in the drive or on the computer. I think the songs are still there but because he said 2321 free/3888 MB. I also had a video