Pivoting manipulation and string
Hi guys I'd appreciate your help with this.I have a table with a column unique = A1, A2, B1, C1, C2, I need to rotate and write the following lines in a second table again as a single column;
A1, B1, C1
A1, B1, C2
A2, B1, C1
A2, B1, C2
An example would be great. Thanks in advance.
Gas
Hello
Gas wrote:
... Hope that it will cover all your questions
N °
Frank Kulash wrote:
... Explain as clearly as possible the business rules. Why don't you not rows in the second table as follows:C1, B1, A1 B1, B1, B1 A1, A2, B1
or do you have?
You know, in advance, that strings all begin with 'A', 'B' or 'C' or the query should understand what are the different possibilities?
I made several assumptions.
INSERT INTO target_tab (col1)
WITH normalized_source_tab AS
(
SELECT REGEXP_SUBSTR ( col1
, '[^ ,]+'
, 1
, LEVEL
) AS txt
, DENSE_RANK () OVER ( ORDER BY REGEXP_SUBSTR ( col1
, '[^ ,0-9]+'
, 1
, LEVEL
)
) AS prefix_num
FROM source_tab
CONNECT BY LEVEL <= 1 + LENGTH (col1)
- LENGTH (REPLACE (col1, ','))
)
SELECT SUBSTR ( SYS_CONNECT_BY_PATH (txt, ', ')
, 3
)
FROM normalized_source_tab
WHERE CONNECT_BY_ISLEAF = 1
START WITH prefix_num = 1
CONNECT BY prefix_num = 1 + PRIOR prefix_num
;
Among other things, I guessed that the elements with commas in sorce_tab.col1 always respect the following diagram:
(1) option spaces, be ignored
(2) non-chiffres, which deterrmine postion in target_tab.col1
(3) figures
Two (2) or (3), but not both, may be omitted. If both are present, (3) can come before (2).
Tags: Database
Similar Questions
-
Manipulation of string or Validation of form for phone numbers
Our SFDC requires phone numbers in the following format: (000) 000-0000. Forms on our Web site automatically manipulate phone numbers to comply with this requirement, but our forms hosted on Eloqua Landing Pages do not have this validation/manipulation. It is originally from the headache, as customers can enter any phone number, then integration triggered to SFDC stalls.
If someone managed to use some kind of JavaScript validation or manipulation on the form itself or RegEx? If this isn't the case, anyone used the cloud of Manipulation of String component to clean the phone as such numbers?
Regular expression validation will be best way users as the required format phone number, on the forms be limited.
Please refer to this post - is there a way to validate phone numbers?
But already existing in Eloqua and contacts from other sources such as the download list, you can probably use String Manipulation Cloud Connector in a program generator, before pushing up to SFDC.
Contacts can have different types of phone formats.
Then you can try with the approach below using the Regex:
1 unformat the phone number for incoming contacts
2. and then reformat the necessary
Unformat: (step 1 of Cloud Connector)
This step will remove all the alphabets, special characters and will return the numbers only
Regex find - \D
Replace with Regex - white
Reformat: (step 2 of Cloud Connector)
Find the Regex: (? = ^.) {} 10}) ({3} \d)(\d{3}) (\d {4})
Regex Replace: ($1) 2 $ - $3
We also need to ensure that the telephone numbers has the country code at the beginning or phone Extension at the end.
In this case before you reformat, you need to check with these cases on the decision rule and then add two steps more Cc with minor changes on the regex find their expression.
It may not meet your requirement of everything, but I hope this will give you an idea.
Thank you
Ashok.
-
I did my browser Bing and it was working fine until today. When I open Firefox I get a message: Ref, then a long string of characters. I click on the Home icon and string changes. After doing this several times, I get the Bing search page. I don't get the startup of Firefox bookmark with the toolbar that has my book, history etc.. I can't clear the cache, if I can't the history tab. If I'm going to the mozilla firefox program folder and open it, there are a tool bar but can't erase recent history, etc. it. I don't have an administrator and a password on my home desktop. It's just me. I tried to follow your suggestions, but they do not apply to my situation. I don't really know if it is a firefox problem or bing. I've used google before bing and had no problems; I just wanted to try bing.
You can attach a screenshot?
- http://en.Wikipedia.org/wiki/screenshot
- https://support.Mozilla.org/KB/how-do-i-create-screenshot-my-problem
Use a type of compressed as PNG or JPG image to save the screenshot.
Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).
- Do NOT click on the reset button on the startup window Mode safe or make changes.
-
The extract number and String and replace with space
Hello
I need to extract number and string of a data table. I use Oracle 8i
For example: 001FI025A, 001PDIT002, 001UXSV029AA
I want to separate as follows
001 025 A FI
001 002 RESULTED
USXV 029 A 001
How can I achieve this? Any help is very useful.
Thank youHello
Welcome to the forum!
You must change "001FI025A" to the name of the column. Example:
SELECT '001FI025A', SUBSTR(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789 '), 1, INSTR(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789 '), ' ')) AS ELEMENT_1, SUBSTR(LTRIM(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', ' ABCDEFGHIJKLMNOPQRSTUVWXYZ')), 1, INSTR(LTRIM(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', ' ABCDEFGHIJKLMNOPQRSTUVWXYZ')), ' ')) AS ELEMENT_2, LTRIM(SUBSTR(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789 '), INSTR(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789 '), ' '))) AS ELEMENT_3, LTRIM(SUBSTR(LTRIM(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', ' ABCDEFGHIJKLMNOPQRSTUVWXYZ')), INSTR(LTRIM(TRANSLATE('001FI025A', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', ' ABCDEFGHIJKLMNOPQRSTUVWXYZ')), ' '))) AS ELEMENT_4 FROM DUAL;
Kind regards
-
PIVOT and string concatenation
Hi everyone ,
I would like to use a pivot query to build a report .is it possible concatenation in Pivot report.
My requirement is
Vinoth RAM Sam Rahul Vimal Arun Visitors Neo tools / connections of mercury / R.Industries / LAU /Forge Fittings of mercury /R.Industries / /Forge LAU Forge/Mercury R.Industries / UAL Any guidance would be appreciated.
Thank you
Colette
Colette wrote:
I would like to use a pivot query to build a report .is it possible concatenation in Pivot report.
My requirement is
Vinoth RAM Sam Rahul Vimal Arun Visitors Neo tools / connections of mercury / R.Industries / LAU /Forge Mercury Fittings/R.Industries / LAU /Forge Forge/Mercury R.Industries / UAL Any guidance would be appreciated.
Yes, it is possible to perform the aggregation of the chain in a pivot report.
How depends completely on the information about your environment, data model and the data you have provided not: How to get the answers from the forum
-
Table with numeric columns and string
Hello everyone. I am a new labviewer, so I have 2 questions fundamental.
1. I found this basic timer loop, which I need to get inside my structure of the event. How to wire this loop with my writing and reading?
2. I need to wire my digital indicator "Elapsed time" with my table, so I want the 'measure' in the first column and "elapsed time" in the second column. I know I can't mix string and digital indicator in the same table, so the best way would be to make two tables 1 d (digital channel), or there are more basic ways to correct the problem?
Thanks in advance
Orlando
2010:
-
Extra character and String worksheet line to read
Hi all
I tried to look, but no idea yet. I'm using labview 7.1 and try to play a file spreadsheet string in an array of strings, but I got the extra character at the beginning of the file and an additional line in each line. I tried to insert a value in the offset of the point of sale, can solve the problem of extra character, but he does not feel. Text file, source code and attached result. Can anyone explain that?
Thank you very much.
Hello Nefertari,
your file contains this extra character (I think it's a unicode file), but they do not show the normal Editor. You can see if you open your file with Word.
Mike
-
How to trace the number and string in a line (meter data via MODBUS recorder)?
Hi all I did the log data amount using digital via modbus (RS485) meter to monitor how much and to reject what has and name operator, Machine and the part number.
I have problem on plot number & string in one line, as shown in the image below:
How to move this channel on a line? I enclose my vi.
Thank you ~.
Hi rhiesnand,
at the moment you add 2 new lines in your table.
The solution is to concatenate the two parts of the line to a greater range of 1 d before adding this table as a new row to your table 2D!
Like this:
-
Mulitpart post http to download images and string parameters
It is the first time I use http multipart post to download files. I download the two parameters of string (token source) and a captured image of terminal BlackBerry. I tried the following code but it gives me error.
I don't know if it's the right way to create the MULTIPART post request.
StringBuffer buffer = new StringBuffer(); String boundary = "--@#$--"; byte[] image = byte[] from camera.getsnapshot; buffer.append(boundary+"\r\nContent-Disposition: form-data;name=\"token\"\r\n"+token+"\r\n"); buffer.append(boundary+"\r\nContent-Disposition: form-data;name=\"source\"\r\n"+"Blackberry"+"\r\n"); buffer.append(boundary+"\r\nContent-Disposition: form-data;name=\"file.jpg\";filename=\""+ filename+"\""+"\n" + "Content-Type:image/jpeg"+"\n"+ "Content-Transfer-Encoding: binary" + boundary +"\r\n" +new String(image)); buffer.append("\r\n" + boundary + "\r\n"); String string = new String(buffer); byte[] post = string.getBytes(); HttpConnection connection = (HttpConnection)Connector.open(url); connection.setRequestMethod(POS); connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE, HttpProtocolConstants.CONTENT_TYPE_MULTIPART_FORM_DATA+ ";boundary="+boundary); connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH,String.valueOf(post.length)); connection.setRequestProperty("User-Agent", "Profile/MIDP_2.0 Configuration/CLDC-1.0"); OutputStream postStream =connection.openOutputStream(); postStream.write(post,0,post.length); postStream.close();
If someone has done this before, your help would be very appreciated
Finally worked,
private final String boundary = "akfdskdjfkl"; private final String lineend = "\r\n"; private final String twoHyphens = "--"; OutputStream pos = connection.openOutputStream(); pos.write(twoHyphens.getBytes()); pos.write(boundary.getBytes()); pos.write(lineend.getBytes()); pos.write("Content-Disposition: form-data; name=\"authenticity_token\"".getBytes()); pos.write(lineend.getBytes()); pos.write(lineend.getBytes()); pos.write(app.userAccount.getUser_auth_token().getBytes()); pos.write(lineend.getBytes()); pos.write(twoHyphens.getBytes()); pos.write(boundary.getBytes()); pos.write(lineend.getBytes()); pos.write("Content-Disposition: form-data; name=\"source\"".getBytes()); pos.write(lineend.getBytes()); pos.write(lineend.getBytes()); pos.write("blackberry".getBytes()); pos.write(lineend.getBytes()); pos.write(twoHyphens.getBytes()); pos.write(boundary.getBytes()); pos.write(lineend.getBytes()); String filename = "blackberry" + filepath; pos.write("Content-Disposition: form-data; name=\"Filedata\"; filename=\"".getBytes()); pos.write(filename.getBytes()); pos.write("\"".getBytes()); pos.write(lineend.getBytes()); pos.write("Content-Type: image/jpeg".getBytes()); pos.write(lineend.getBytes()); pos.write(lineend.getBytes()); pos.write(image, 0, image.length); pos.write(lineend.getBytes()); pos.write(twoHyphens.getBytes()); pos.write(boundary.getBytes()); pos.write(twoHyphens.getBytes()); pos.write(lineend.getBytes());
Formatted string is vital, accurate use of hyphens, limit, and new line must be ensured.
-
Persistent [store and String]
I am fairly new to the BlackBerry development but have a vast experiece in c# so I understand the syntax, but I'm having a hard time getting an array of String to save in the persistent store.
Here's a piece of my constructor code:
pObjet = PersistentStore.getPersistentObject (key);
If (pObject.getContents () is nothing)
{
sFriendList = new String() {"no friends added"};
pObject.setContents (sFriendList);
}
on the other
{
sFriendList = (String []) pObject.getContents ();
}
Add (olfList);olfList.set (sFriendList);
Here is the custom method that is called the closure of my custom screen:
public void AddFriendCallback (String sFriend)
{
String [] NewArray;
If (sFriendList [0] .equals ('no friends added"))
{
NewArray = new String() {sFriend};
}
on the other
{
NewArray = new String [sFriendList.length + 1];
for (int i = 0; i)< sfriendlist.length;="">
{
NewArray [i] = sFriendList [i];
}
NewArray [NewArray.length - 1] = sFriend;
}
sFriendList = NewArray;
olfList.set (sFriendList);
}And here is my saving method:
public void save() throws IOException
{
pObject.commit ();
}Everything works fine until I try to write the data to store and reopen the form. When I open it the screen is like nothing has been added to the store. He said still "no added friend. Anyone know what I am doing wrong?
Thanks in advance!
I thought about it. Just after the olfList.set (sFriendList); line in my callback method, that I had to do the following:
-
How to handle parsing JSON with Java for String and String []?
I have a string of JSON (sample) as follows and I created a POJO Mapper using Jackson to manage the same, but as I saw the data I noticed the problem mentioned
How should I treat the underside of change of the data of String() string in my class Mapper POJO of ideas would be helpful
< code >
@JsonIgnoreProperties(ignoreUnknown = true) public class Ref implements Serializable { @JsonProperty("BBT") private String BBT; .... more code here //Sample 1 "Ref": { "ISN": "AEBDC44", "CCD": "213128908338", "BGID": "XCAS3213213", "BBS": "23123123", "BBT": "CCC", "WRT": "POP91230", "SDL": "290123", "BUN": "ZZRET10PV4", "BCSP": "ZZRET10PV4", "CSP": "ZZRET10PV4" } //Sample 2 "Ref": { "ISN": "AEBDC44", "CCD": "213128908338", "BGID": "XCAS3213213", "BBS": "23123123", "BBT": ["CCC","AAA"], //Sometimes recevied as an String array instead of String "WRT": "POP91230", "SDL": "290123", "BUN": "ZZRET10PV4", "BCSP": "ZZRET10PV4", "CSP": "ZZRET10PV4" }
< code >
Found the solution.
Thank you seems in any case this forum is not very active over after stackoverflow etc. dominating the WRT forums programming and all
In the case of some1 should
Change return type
Converted to object.
-
How flat Animation - ball and String?
Hey there,
I created a base-ball, flat shape in Illustrator (just an oval and a triangle) and plan to import into After Effects. The ball will be moving upward (straight line) and I intend to add a string with a very slight tremor.
Then, I thought that the best way to add the string would be to create a thin rectangle shape in After Effects itself.
How do I fix this chain on the ball and animate it? It would be using the puppet tool? As well as an effect of earthquake?
Thanks for the tips!
You used the string to the ToolTip with parents or you will put both the chain and ball in the shape layer. I probably wouldn't use corner puppet to animate the chain. I'll explain why later. I would use a rectangle for the chain, I would use the pen tool to draw an open path of contours.
Once you have the selected path, you can add a host of form by clicking on the button Add and add a Wiggle the path that you use to string.
If the ball and chain are separated layers parent just them. If they are both on the same layer, you must make sure that the Wiggle modifier only applies to the string. Then just animate the position of the string.
To learn more about animation forms type shape layers in the search help field at the top right of EI and learn about the resources of the community. You will find information much better YouTube search for help.
The reason I would not use puppet PIN as my first choice is that you can use any of the controls transform on a layer with puppet pin applied and the mesh must be dense enough to animate a string. If you do not want puppet pin allows to create an organic movement of the chain by recording your movements, you'd then have to dial all attributes before the puppets moving pin layer to the new layer then parent the layer spindle of nested balloon puppets and animate the position of the parent.
One last thing. If you want an animation of rotation in the bubble, it would be a good idea to move the anchor Point of the layer ball at the bottom of the work, or you could use a null value as a parent for the ball and chain and position the anchor point of the null where you want the center of rotation.
-
OOM playing with StringBuilder and String
Hi list
I want to check the diff between concatination partial string using stringbuffer (pmd create a suspicion around the sign + inside the stringbufffer.append).
now I write follow the example of code:
public class StringBuffererf
{
Public Shared Sub main (String [] args)
{
nrLoops long = 100000000;
StringBuffer sb = new StringBuffer();
Start long = System.currentTimeMillis ();
for (int i = 0; i < = nrLoops; i ++)
{
If (I / 1000 == 0)
{
SB = new StringBuffer();
}
SB. Append ("asd1" + "asd2" + "asd3" + "TSA4" + "asd5" + "asd1" + "asd2" + "asd3" + "TSA4" + "asd5");
}
System.out.println ("time:" + (System.currentTimeMillis () - start));
Start = System.currentTimeMillis ();
for (int i = 0; i < = nrLoops; i ++)
{
If (I / 1000 == 0)
{
SB = new StringBuffer();
}
SB. Append ("asd1");
SB. Append ("asd2");
SB. Append ("asd3");
SB. Append ("asd4");
SB. Append ("asd5");
SB. Append ("asd1");
SB. Append ("asd2");
SB. Append ("asd3");
SB. Append ("asd4");
SB. Append ("asd5");
}
System.out.println ("time:" + (System.currentTimeMillis () - start));
}
}
an interesting around this code is: partial + operations within a stringbuffer is faster then use each time an addition.
But if I increase the number of loops I get an oom.
IMHO I don't expect this, because with
If (I / 1000 == 0)
{
SB = new StringBuffer();
}
I have however, that release the object and free memory also.
I have sore around it and I've got the cause of the oom.
suspicion and or advanced are welcome
Best regards
Dietmar
The expression ' I / 1000 ' is not what you think it does.
You test not concatenation of the way you wrote it because the compiler, not the virtual machine does concatenation.
Presumably, you understand the difference between StringBuffer and StringBuilder.
-
Tricky Regexp and string of SQL column row
Hi all
I am trying to build a SQL that can convert a string passed as
TOHP|250 GB * 2 + 80 GB * 3 + 100 GB | SATA
So far, my attempt is (who tells me to learn more about regexp)HP | 250 GB | SATA HP | 250 GB | SATA HP | 80 GB | SATA HP | 80 GB | SATA HP | 80 GB | SATA HP | 100 GB | SATA
And output, I've got so far is:WITH T AS ( SELECT q'[HP|250 GB * 2 + 80 GB * 3 + 100 GB | SATA]' str FROM DUAL ), t2 AS (SELECT trim(regexp_substr(str,'[^|]+',1,level)) val FROM T CONNECT BY level <= LENGTH (str)-LENGTH(REPLACE(str,'|'))+1 ),t3 AS (SELECT DISTINCT trim(regexp_substr(val,'[^+]+',1,level)) val FROM t2 WHERE VAL LIKE '%*%' OR VAL LIKE '%+%' CONNECT BY level <= LENGTH (val)-LENGTH(REPLACE(val,'+'))+1 ),t4 as (SELECT VAL,ROWNUM RN FROM T2 A1 WHERE VAL NOT LIKE '%*%' OR VAL NOT LIKE '%+%'), t5 as (SELECT A.VAL MK, T3.VAL CONFG, B.VAL TYP FROM T3, (SELECT VAL FROM T4 WHERE RN = 1)A,(SELECT VAL FROM T4 WHERE RN = 2) B) SELECT * FROM T5;
Please suggest that more need to do to get the desired result (year SQL)?MK CONFG TYP ----------------------------------------- ----------------------------------------- ----------------------------------------- HP 80 GB * 3 SATA HP 250 GB * 2 SATA HP 100 GB SATA
Thanks for reading this postBANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for 32-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production
* 009 *.with t1 as ( select 'HP|250 GB * 2 + 80 GB * 3 + 100 GB | SATA' str from dual union all select 'INTEL|40 GB + 55 GB| IDE' from dual ), t2 as ( select regexp_substr(str,'^[^|]+') mk, trim(regexp_substr(replace(str,'|','+'),'[^+]+',1,column_value + 1)) element, regexp_substr(str,'[^|]+$') typ from t1, table( cast( multiset( select level from dual connect by level <= length(regexp_replace(str || '+','[^+]')) ) as sys.OdciNumberList ) ) ) select mk, trim(regexp_replace(element,'\*.*$')) val, typ from t2, table( cast( multiset( select level from dual connect by level <= substr(regexp_substr(element,'\*.*$'),2) ) as sys.OdciNumberList ) ) / MK VAL TYP ---------- ---------- ---------- HP 250 GB SATA HP 250 GB SATA HP 80 GB SATA HP 80 GB SATA HP 80 GB SATA HP 100 GB SATA INTEL 40 GB IDE INTEL 55 GB IDE 8 rows selected. SQL>
SY.
P.S. Message your version. If 11.1, it can be simplified. If 11.2 can be even simpler. -
Pivot table and Firefox 3.6,
Hello
I find a problem in the PivotTable.
I made a table very simple pivot, with the region of filter enabled.
I use jdeveloper 11g release 1.
When you run it in firefox 3.6 you can't move columns or rows. If you look at the firefox error console, you find an error in javascript:
Error: x5.ownerDocument.getBoxObjectFor is not a function
Origen archivo::7101/UsoCanalesRelacion-ViewController-context-root/afr/partition/gecko/default/opt/core-SHEPHERD-PS1-9296.js http://127.0.0.1
Line: 6166
If I run it in explore 8, it works very well.
Is a bug?
A bad configuration of firefox?
ThanxYou hit the bug drag-and - déposer in FF3.6. D & D ff3.6 with adf faces rich does not now :-(
Timo
Maybe you are looking for
-
Menu and toolbars, tabs suddenly LARGE, need to reset Firefox, not fixed by eliminating add-ins, only a reset works - help!
-
How can I connect to wifi, it seems as if I need a password. do I have to contact the site some how.
-
Stor.e don't Slim for Mac after the password no CCADE
Hello I have a Toshibe 1 TB Stor-e Slim for Mac.I backed up all my data on the drive and created a password with the password tool. I had to reinstall my Macbook Pro, but unfortunately after that the device is not accessible.I tried looking for the p
-
It's a Thinkpad r60 9455WT-W25 with a motherboard Intel i945GM rev.03 [uncertain if 82801GHM (ICH7-M/U) rev03 part is too important]. It comes with a processor Intel Core Duo T2300E , which does not support 64-bit operating systems. This is one of th
-
Try to download security updates, but after restarting the computer it says it can't reconfigure windows?