splits the string into documents
HelloI did a query (see regexp) that split a string into records. The problem with the query is the separate in the subquery. Otherwise, it returns millions of records where I expect less than a thousand.
Meanwhile, I found an other solution (see xmlsequence), but this statement returns the message "ORA-03113: end of file on the communication channel.
Please advice.
regexp:
SELECT smp.sample_id
FROM
(
SELECT sa.sample_id, sau.u_box_code, sau.u_box_position
FROM lims_sys.sdg sd, lims_sys.sdg_user sdu, lims_sys.sample sa, lims_sys.sample_user sau
WHERE sd.sdg_id = sdu.sdg_id
AND sd.sdg_id = sa.sdg_id
AND sa.sample_id = sau.sample_id
AND sau.u_padded_out = 'F'
AND sdu.u_client_type = decode('#Client#','-1',sdu.u_client_type,'#Client#')
AND sdu.u_crop_group = decode('#Crop#','-1',sdu.u_crop_group,'#Crop#')
AND sdu.u_year_of_sample_delivery = decode('#Year#',-1,sdu.u_year_of_sample_delivery,'#Year#')
AND sdu.u_week_of_processing = decode('#Week#',-1,sdu.u_week_of_processing,'#Week#')
AND sd.status IN ('V','P','C')
) smp,
(
SELECT distinct box_code, regexp_substr(box_pos,'[^,]+',1,level) box_pos
FROM
(
SELECT p.name box_code, substr(p.description,instr(p.description, 'NP=') + 3) box_pos
FROM lims_sys.plate_template pt, lims_sys.plate p, lims_sys.plate_user pu
WHERE pt.plate_template_id = p.plate_template_id
AND p.plate_id = pu.plate_id
AND pt.name = 'Box96'
AND p.status IN ('V','P','C')
AND p.description like '%NP=%'
AND pu.u_client_type = decode('#Client#','-1',pu.u_client_type,'#Client#')
AND pu.u_crop_group = decode('#Crop#','-1',pu.u_crop_group,'#Crop#')
AND pu.u_year = decode('#Year#',-1,pu.u_year,'#Year#')
AND pu.u_week = decode('#Week#',-1,pu.u_week,'#Week#')
)
connect by level <= length(box_pos) - length(replace(box_pos,',')) + 1
) box
WHERE smp.u_box_code = box.box_code
AND smp.u_box_position = box.box_pos
xmlsequence: SELECT smp.sample_id
FROM
(
SELECT sa.sample_id, sau.u_box_code, sau.u_box_position
FROM lims_sys.sdg sd, lims_sys.sdg_user sdu, lims_sys.sample sa, lims_sys.sample_user sau
WHERE sd.sdg_id = sdu.sdg_id
AND sd.sdg_id = sa.sdg_id
AND sa.sample_id = sau.sample_id
AND sau.u_padded_out = 'F'
AND sdu.u_client_type = decode('#Client#','-1',sdu.u_client_type,'#Client#')
AND sdu.u_crop_group = decode('#Crop#','-1',sdu.u_crop_group,'#Crop#')
AND sdu.u_year_of_sample_delivery = decode('#Year#',-1,sdu.u_year_of_sample_delivery,'#Year#')
AND sdu.u_week_of_processing = decode('#Week#',-1,sdu.u_week_of_processing,'#Week#')
AND sd.status IN ('V','P','C')
) smp,
(
SELECT box_code, trim(x.column_value.extract('e/text()')) box_pos
FROM
(
SELECT p.name box_code, substr(p.description,instr(p.description, 'NP=') + 3) box_pos
FROM lims_sys.plate_template pt, lims_sys.plate p, lims_sys.plate_user pu
WHERE pt.plate_template_id = p.plate_template_id
AND p.plate_id = pu.plate_id
AND pt.name = 'Box96'
AND p.status IN ('V','P','C')
AND p.description like '%NP=%'
AND pu.u_client_type = decode('#Client#','-1',pu.u_client_type,'#Client#')
AND pu.u_crop_group = decode('#Crop#','-1',pu.u_crop_group,'#Crop#')
AND pu.u_year = decode('#Year#',-1,pu.u_year,'#Year#')
AND pu.u_week = decode('#Week#',-1,pu.u_week,'#Week#')
) t, table (xmlsequence(xmltype('<e><e>' || replace(t.box_pos,',','</e><e>')|| '</e></e>').extract('e/e'))) x
) box
WHERE smp.u_box_code = box.box_code
Hello
When 'LEVEL '.<= x"="" is="" the="" only="" connect="" by="" condition,="" then="" you="" should="" be="" using="" a="" table="" that="" has="" only="" one="" row,="" like="">=>
You can generate a Table of counters (a result set, in fact) who has all the integers that you need and then join one.
The next thread is an example:
I don't don't want to mark in plsql
Tags: Database
Similar Questions
-
Oracle regular expressions - splits the string into words for
Hello
Nice day!
My requirement is to split the string into words.
So I need to identify the new line character and the semicolon (;), comma and space like terminator for string entry.
Please note that I am currently embedded blank and the comma as separator, as shown below.
Select regexp_substr('test)
TO
string in words, "([^, [: blanc:]] +) (', 1, 1) double;"How to integrate the semicolons and line break characters in regular expression Oracle?
Please notify.
Thanks and greetings
Sree
This has nothing to do with REGEXP. Is SQL * more parser does not not a semicolon at the end of the line:
SQL > select ' testto, mm\;
ERROR:
ORA-01756: city not properly finished chainSQL >
Just break the chain:
SQL > select regexp_substr ('testto, mm\;' |) '
2 string into words
3 \w+',1,level ',') of double
4. connect by level<= regexp_count('testto,mm\;'="" ||="">=>
5 string in words
6 ','\w+')
7.REGEXP_SUBSTR ('TESTTO, MM\;' |') STRINGIN
--------------------------------------
Testto
mm
string
in
WordsSQL >
Or modify SQL * more the character of endpoints:
SQL > set sqlterm.
SQL > select regexp_substr ('testto, mm\;)
2 string into words
3 \w+',1,level ',') of double
4. connect by level<=>=>
5 string in words
6 ','\w+')
7.REGEXP_SUBSTR ('TESTTO, MM\;) STRINGINTOWO
--------------------------------------
Testto
mm
string
in
WordsSQL >
SY.
-
splits the string into 3 parts
Hello
I have a requirement to split the string into 3 different room example inf.ethz.ch should be subdivided into inf ethz ch in 3 different column
We have table called email within this column contains all identification of email we need to divide email with dot (.) in different columns and display please suggest how to implement in the query
Thank you
Sudhir
Use REGEXP_SUBSTR:
SQL > with t as (select ' inf.ethz.ch' double txt)
2 Select regexp_substr (txt,'[^.] +') part_1,.
3 regexp_substr (txt,'[^.] +', 1, 2) part_2,.
4 regexp_substr (txt,'[^.] +' 1, 3) part_3
5 t
6.BY PARTY PA
--- ---- --
INF ethz chSQL >
Or you can use SUBSTR + Instr.
SY.
-
SQL / PLSQL to split the string into pieces
Hi all
I have a problem of data conversion from the name of one table to another structure.
for example
SQL > desc names
Name Null? Type
----------------------------------------- -------- ----------------------------
TITLE VARCHAR2 (5)
FNAME VARCHAR2 (20)
LNAME VARCHAR2 (20)
SQL > Data desc
Name Null? Type
----------------------------------------- -------- ----------------------------
FULLNAME VARCHAR2 (50)
Insert in data values ("SIR I HAVE ONE NAME PARTICULARLY LONG INDEED");
Insert in the data values ("MINE IS EVEN MORE, ENOUGH RIDICULEMENT so IN FACT");
Essentially, I need to divide these names long, stored in the 1 field, in the above 3 fields. The trickiest part is however I want to do it in such a way so that if the 1st part of the name fits the 1 5 char field I want to do, otherwise I would divide between 2 fields - once again without splitting a string. The reason behind this is that application will automatically put a space between each field when they appear and I would avoid gaps in the names if possible.
This baffled me a little if any help would be seriously great... it might not even be a go-er, as it might be too uneconomic with the amount of available space, but I would give it a shot.
Thank you!
AdamHi, Adam.
Use regular expressions:
INSERT INTO names (title, fname, lname) SELECT RTRIM (REGEXP_SUBSTR ( fullname , '^.{1,5} ' ) ) , REGEXP_REPLACE ( fullname , '(^.{1,5} )?' || -- \1 = optional 1-5-letter word(s) '(.{1,20})' || -- \2 = 1-20 letters '(( .*)|$)' -- \3-\4 = space (plus anything) or end , '\2' ) , REGEXP_REPLACE ( fullname , '(^.{1,5} )?' || -- \1 = optional 1-5-letter word(s) '(.{1,20}( |$))' || -- \2-\3 = 1-20 letters and space or end '(.{1,20})?' || -- \4 = 0-20 letters '(( .*)|$)' -- \5 = space (plus anything) or end , '\4' ) FROM data_table -- data is not a good name ;
Published by: Frank Kulash, August 18, 2009 11:13
Revised to manage long single word fullname -
Need help to split the string into two fields
Can someone share your thoughts by dividing the prod_info string below into two fields
For example:-TABLE of PROD
SOURCE TABLE
SNO PROD_INFO 1 20 OZ SIMILAC 2 HW PRO 10 3 REX 10 OZ 4 AAA 10 5 BBB 2000 6 CCC 10 LB 7 DDD 2021 8 EE 12 KG 9 KK 11111 10 ZZ ABC FAC 11 11 RKW DD CC 12 OZ 12 12KJ 12 LBS. EXPECTED RESULTS
SNO PROD_INFO PROD_VAL 1 SIMILAC 20 OZ 2 HW PDR 10 3 REX 10 OZ 4 AAA 10 5 BBB 2000 6 CCC 10 LB 7 DDD 2021 8 EA 12 KG 9 KK 11111 10 AEC ABC ZZ 11 11 RKW DD CC 12 OZ 12 12KJ 12 LBS. with
as Prod
(select 1 sno, "SIMILAC 20 OZ" prod_info of all the double union)
Select 2, 'HW PDR 10' from dual union all
Select 3, 'REX 10 OZ' from dual union all
Select option 4, "AAA 10' from dual union all
Select 5, "BBB 2000"of the dual union all
Select 6, 'CCC 10 LBS' double union all
Select 7, 'DDD 2021' from dual union all
Select 8, 'EE 12 KG' from dual union all
Select 9, 'KK 11111' Union double all the
choose 10, "ZZ ABC FAC 11' from dual union all
Select 11, 'CC DD RKW 12 OZ' from dual union all
Order 12, '12KJ LB 12' double
)
Select sno,
(prod_info regexp_substr(prod_info,'^((\d*|\w*)[^[:digit:]].*) \d',1,1,null,1).
regexp_substr (prod_info,' prod_value (\d+.*)$',1,1,null,1))
Prod
SNO PROD_INFO PROD_VALUE 1 SIMILAC 20 OZ 2 HW PDR 10 3 REX 10 OZ 4 AAA 10 5 BBB 2000 6 CCC 10 LB 7 DDD 2021 8 EA 12 KG 9 KK 11111 10 AEC ABC ZZ 11 11 RKW DD CC 12 OZ 12 12KJ 12 LBS. Concerning
Etbin
-
Splits the string into two columns
Can someone please help me the following
I want to divide into two columns URL and ID /cfd/abc.html,/night/aaa/Page1,/can/MLP/Page2|107
Result must be
Temporary table
< font color = "red" > URL < / police > < font color = 'blue' > ID < / make >
< font color = "red" > /cfd/abc.html < / police > < font color = "blue" > 107 < / make >
< font color = "red" > / night/aaa/page 1 < / police > < font color = "blue" > 107 < / make >
< font color = "red" > / can/MLP/Page2 < / police > < font color = "blue" > 107 < / make >
There can be N number of comma separated URLs, but there will be only 1 separate ID which is the vertical bar (|)Try this,
SQL> WITH T 2 AS (SELECT '/cfd/abc.html,/night/aaa/Page1,/can/MLP/Page2|107 ' str FROM DUAL UNION ALL 3 SELECT '/cfd/def.html,/bbbb/bbbb/Page1,/lll/MLP/Page3|108 ' str FROM DUAL) 4 SELECT REGEXP_SUBSTR ( str, '[^,|]+', 1, lvl) URL, 5 REGEXP_SUBSTR ( str, '[^|]+', 1, 2) ID 6 FROM T, 7 (SELECT LEVEL lvl 8 FROM (SELECT MAX (LENGTH (REGEXP_REPLACE ( str, '[^,]'))) mx FROM T) 9 CONNECT BY LEVEL <= mx + 1) 10 WHERE Lvl - 1 <= LENGTH (REGEXP_REPLACE ( str, '[^,]+')) 11 order by id,lvl; URL ID -------------------------------------------------- ------------------------------------------------- /cfd/abc.html 107 /night/aaa/Page1 107 /can/MLP/Page2 107 /cfd/def.html 108 /bbbb/bbbb/Page1 108 /lll/MLP/Page3 108 6 rows selected. SQL>
G.
-
Splits the string into two columns to dashboard
Hi all
I got thisworking
decode (SUBSTR (ADDR2_ATTR_1, 1, INSTR(ADDR2_ATTR_1,'-')-1), '9999', NULL, (SUBSTR (ADDR2_ATTR_1, 1, INSTR(ADDR2_ATTR_1,'-')-1))),
decode (SUBSTR (ADDR2_ATTR_1, INSTR (ADDR2_ATTR_1,'-') + 1), '9999', NULL, (SUBSTR (ADDR2_ATTR_1, INSTR(ADDR2_ATTR_1,'-') + 1)))
but the results were a little different.
It came as
Col1 for 8-10 have come beauiful... .but however Col2 data should be in K1 and transferred to Col2
Col1 Col2
< null > 10
< null > 33
8 10
Any guidance is appreciated.Personally, I like the cases, but another way using the DECODE method...
WITH t AS (SELECT '8-10' str FROM DUAL UNION ALL SELECT '163' FROM DUAL UNION ALL SELECT '789' FROM DUAL) SELECT str col1, DECODE (NVL2 (NULLIF (INSTR (str, '-'), 0), 99999, 0),99999, SUBSTR (str, 1, INSTR (str, '-', 1) - 1),str) col2, DECODE (NVL2 (NULLIF (INSTR (str, '-'), 0), 99999, 0),99999, SUBSTR (str, INSTR (str, '-', 1) + 1),NULL) col3 FROM t;
Simplified:
------WITH t AS (SELECT '8-10' str FROM DUAL UNION ALL SELECT '163' FROM DUAL UNION ALL SELECT '789' FROM DUAL) SELECT str col1, DECODE (SIGN (INSTR (str, '-')),1, SUBSTR (str, 1, INSTR (str, '-', 1) - 1),str) col2, DECODE (SIGN (INSTR (str, '-')),1, SUBSTR (str, INSTR (str, '-', 1) + 1), NULL) col3 FROM t;
OUTPUT:
COL1 COL2 COL3 8-10 8 10 163 163 789 789
See you soon,.
Manik.Published by: adding a simplified version
-
I implemented the Oracle text search in my database. Now I have this query
Select ctx_thes.syn ('RED', 'MY_THESAURUS') of double;
the output is displayed as
{RED} | {MIXTURE OF RED} | {TABLE RED} | {RED}
and I want to get the words in separate lines, i.e.
Red
Mixture of Red
Red table
Red wine
How to split the string into lines?
SELECT * FROM ( SELECT DISTINCT REGEXP_SUBSTR ('{RED}|{RED BLEND}|{RED TABLE}|{RED WINE}', '({)([A-Z]+ *[A-Z]*)(})', 1, LEVEL, 'i', 2) val FROM DUAL CONNECT BY LEVEL <= REGEXP_COUNT ( '{RED}|{RED BLEND}|{RED TABLE}|{RED WINE}', '|') + 1) WHERE val IS NOT NULL;
-
How to split a string into several substrings parent using a delimiter
Hello
I am forced to split a string into several substrings parent using a delimiter.
And insert these substrings in variuou of the columns of a table in a row.
For example. The sting is: ABC * DEF * GHI * JKH *.
where ' *' is the separator.
Desired output:
Col1 Col2 Col3 Col4 Col5
------- -------- -------- ------- ---------
JKH GHI ABC DEF (null)
Could you please guide me how can I achieve this.
Thank you
Bogoss
Hello Salim,
Leave the thread for reference... got this excerpt:
with t as
(
Select "c: its: hgfd:1:23" Str
)
Select
REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 1, null, 1) col1
, REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 2, null, 1) col2
, REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 3, null, 1) col3
, REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 4, null, 1) col4
, REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 5, null, 1) col5
t;
This code snippet works well, but for the fixed columns. Here are 5 predefined columns.
But I need to have a logic that I can browse the string any No.. sometimes.
For example. If I get 3 secondary channels of the parent chain... I need to insert into 3 columns.
And if I get 6 strings under... I need to insert into 6 columns.
Could you please help me develop a logic like that.
I use Oracle database 10g.
And the data are currently being collected on external table... but I can store in a variable or a column of a database table.
Thank you
Bogoss
-
How to split a string into columns
Hi all
Have a strings like this, where the delimiter is
Thanks in advance10:00 | x1 | 2 | RO | P | Con ausilio | y1 10:10 | x2 | 1 | RO | | | y2 10:20 |x3 | 3 | | | | y3 10:30 |x4 | 3 | RO | N | Con aiuto | y4 10:40 |x5 | 1 | RO | | | y5 how can I break it up into columns, for example, the first char(before first pipe) insert in first variable, then, after first pipe, second characters in a other column ans so on col1 := '10:00'; col2 := 'x1'; col3 := '2'; col4:= 'RO'; col5 := 'P'; col6 := ' Con ausilio '; col7 := 'y1'; col1 := '10:10'; col2 := 'x2'; .. and so on
Hello
If you want to split the string str into 7 columns :
SELECT TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 1)) AS col1 , TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 2)) AS col2 , TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 3)) AS col3 ... , TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 7)) AS col7 FROM table_x ;
If you want to split it inot 7 variables :
col1 := TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 1)); col2 := TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 2)); col3 := TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 3)); ... col7 := TRIM (BOTH FROM REGEXP_SUBSTR (str, '[^|]+', 1, 7));
-
Concatenate and split the string
Hi all
Is there some how we can split the string like this "1 | ~ | Diego | Maradona | ~ | Footballer | The Argentina.
in the table of 3 elements: '1', ' Diego | Maradona', ' football '. The Argentina.
Here is my code
and put it is:public static void main(String args[]){ System.out.println("========USE SPLIT========== " ); String data = "1 |~| Diego|Maradona |~| Footballer|Argentina"; String[] items = data.split(" |~| "); for (String item : items) { System.out.println("item = " + item); } StringTokenizer tok = new StringTokenizer(data," |~| "); System.out.println("========USE TOKENIZER========== " ); while(tok.hasMoreElements()){ System.out.println("item = " + tok.nextToken()); } }
= USE SPLIT =.
Item = 1
Item = |
Item = |
Item = Diego | Maradona
Item = |
Item = |
Item = football | Argentina
= USE TOKENIZE =.
Item = 1
Item = Diego
Item = Maradona
Item = footballer
Item = Argentina
Published by: mycoffee on February 1, 2011 06:49Split() takes a regular expression. ' | ' has a special meaning in regular expressions.
Try to use
" \\|~\\| "
as the argument of split()
-
Hello
I have string like below, and I want to divide and insert the numbers in another column.
Example of
---------------
test012345
ABC] 9876
Output should be as below so that once I am able to split can insert into 2 separate table columns
test 012345
ABC] 9876
Try this
with t as
(
Select 'test012345' c all the double union
[Select ' abc] 9876' double
)
Select col1, col2 regexp_replace(c,'[^[:digit:]]') t regexp_replace(c,'[[:digit:]]')
COL1 COL2
---------- ----------
test 012345
ABC] 9876
2 selected lines.
-
split the file into 3 files xml txt
I am creating 3 xml from 1 file txt in javascript files.
I insofar as:
A file containing text:
GP0006896 # SunGold - 3 small # 00 NV ###Zespri Service Center # KLT0000110 # 16950 ###tray Kiwi SunGold pack of 3 small ###JWM # ZESPRI - 3 - D$ $$
GP0012816 # S500-R012336 # 00 ###Poppies Nederland BV # KLT0000081 # 17890 ###Plus slagroomsoes 250 g #JWM # CULI - 10 - B$ $$
GP0009000 ###test 01 # ###Just a test # KLT0001010 # 20596 ###Dit is een regel ###Standaard # TEST test - 01 - B$ $$
The script:
Set the variable
var txtfolderpath = app.path+'/XML_converter/';
var txtfilename = "txt_to_xml.txt";
var txtfilelocation = File (txtfolderpath + txtfilename);
var xmlfolderpath = app.path+'/XML_converter/xml/';
var retChar = eval (' string.fromCharCode(0)) (13)');
var presscancelbutton = 0;
AppVersion var = app.version;
var appversionarray = appversion.split('.');
AppVersion = new Number(appversionarray[0]);
xmlString = var ";
Scriptfolderpathcheck
#target illustrator
var pathcheck = File($.fileName).parent.fsName;
infopanelmenu();
function infopanelmenu() {}
Res =.
"dialog box {------}.
text: "TXT to XML format:', \"
Properties: {resizable: false},
margin: [0,0,0,0],
ImageGroup: group {orientation: 'stack', preferredSize: 400 (221) and alignChildren: 'low'------}
No.: group {orientation: 'column', margins: [0,0,0,20], \}
infopanelgroup: Panel {orientation: 'column', preferredSize: 360 (20) and alignChildren: 'top', text: "TXT to XML conversion,"------}
XmlGroup: group {orientation: 'row', alignment: 'left',------}
s: StaticText {text: "XML converted: '"},
S2: StaticText {text: '0'}, \
} \
statusgroup: group {orientation: 'row', alignment: 'left',------}
s: StaticText {text: "Status:"},
S2: StaticText {text: 'Ready to start'}, \
} \
} \
infopanelbuttons: group {orientation: "rank", align: 'center', \}
cancelBtn: button {text: 'Cancel', properties: {name: 'Cancel'}}, \
applyBtn: button {text: 'Start', properties: {name: 'apply'}}, \
} \
} \
} \
}";
WinInfo = new window (res);
wininfo.frameLocation = [100, 100];
Buttons
wininfo.imagegroup.jobgroup.infopanelbuttons.cancelBtn.onClick = function () {}
presscancelbutton = presscancelbutton - 1;
WinInfo. Close();
};
wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.onClick = function () {}
BuildXml();
};
WinInfo. Center();
WinInfo. Show();
}
function buildxml() {}
txtfilelocation. Open ('read');
txtfile = txtfilelocation.read ();
XmlArray var = txtfile.split('$$$');
wininfo.ImageGroup.JobGroup.infopanelgroup.statusgroup.S2.Text = "Running";
wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.text = "Running";
wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.enabled = false;
To read none
for (i = 0; i < xmlarray.length - 1; i ++) {}
var subxmlarray is xmlarray [i].split('###');.
var counter = i + 1;
xmlString = var ";
xmlString = xmlstring + ' <? XML version = "1.0" encoding = "UTF-8"? > ' + retChar;
xmlString = xmlstring + "< xml >" + retChar;
xmlString = xmlstring + '< gp_number >' + subxmlarray [0] + "< / gp_number > ' + retChar;"
xmlString = xmlstring + '< Steckerhalter >' + subxmlarray [1] + "< / number > ' + retChar;"
xmlString = xmlstring + '< versienummer >' + subxmlarray [2] +' < / versienummer > ' + retChar;
xmlString = xmlstring + '< klantnaam >' + subxmlarray [3] +' < / klantnaam > ' + retChar;
xmlString = xmlstring + '< klantnummer >' + subxmlarray [4] +' < / klantnummer > ' + retChar;
xmlString = xmlstring + '< ID >' + subxmlarray [5] + ' / ID <>' + retChar;
xmlString = "< artikelomschrijving >" + xmlstring + subxmlarray [6] +' < / artikelomschrijving > ' + retChar;
xmlString = "< workflow >" + xmlstring + subxmlarray [7] +' < / workflow > ' + retChar;
xmlString = "< stans >" + xmlstring subxmlarray + [8] +' < / stans > ' + retChar;
xmlString = xmlstring + ' < / xml > '
wininfo.ImageGroup.JobGroup.infopanelgroup.XmlGroup.S2.Text = counter;
Alert (xmlString); / / see if the stingbuild works <-works here 3 times
Save the function
var filename = subxmlarray [0] + ".xml";
var xmlsavelocation = File (xmlfolderpath + filename);
xmlsavelocation. Open ('w');
xmlsavelocation.writeln (xmlString); / / Save the string <-works here 3 times, but generates two empty documents!
xmlsavelocation. Close();
}
txtfilelocation. Close();
wininfo.ImageGroup.JobGroup.infopanelgroup.statusgroup.S2.Text = "Ready"
wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.text = "start";
wininfo.imagegroup.jobgroup.infopanelbuttons.applyBtn.enabled = true;
}
The output:
You will see that I get 3 files but 2 0 bytes.
The question:
Why can't I save the other two strings in an xml file?
Thank you, Daniel
Resolved:
Divide the return in the text thus file to do the work function stop.
Daniel
-
split a string into pl/sql
Hello
How to split a string and store in an associative array in pl/sql.function
My string like this
'1102,1101,1012,1011,1010,1009,1008,1007,1006,10005,1004,1003,1002,1001'
and assign it to the array list. According to
can someone please help
concerning
rYou can try the following. Although I recommend, it would be better to write the function code php as a java stored procedure parser and use the result. We have a class defined in Java String Tokenizer.
-- Define function to split string into tokens FUNCTION get_token( p_input_string IN VARCHAR2, -- input string p_token_number IN PLS_INTEGER, -- token number p_delimiter IN VARCHAR2 DEFAULT ',' -- separator character ) RETURN VARCHAR2 IS v_temp_string VARCHAR2(32767) := p_delimiter || p_input_string ; v_pos1 PLS_INTEGER ; v_pos2 PLS_INTEGER ; BEGIN v_pos1 := INSTR( v_temp_string, p_delimiter, 1, p_token_number ) ; IF v_pos1 > 0 THEN v_pos2 := INSTR( v_temp_string, p_delimiter, 1, p_token_number + 1) ; IF v_pos2 = 0 THEN v_pos2 := LENGTH( v_temp_string ) + 1 ; END IF ; RETURN( SUBSTR( v_temp_string, v_pos1+1, v_pos2 - v_pos1-1 ) ) ; ELSE RETURN NULL ; END IF ; EXCEPTION WHEN OTHERS THEN RAISE; END get_token; -- Call the above function in loop for a string with N tokens DECLARE TYPE assoc_arr_str_typ IS TABLE OF VARCHAR2(100) INDEX BY PLS_INTEGER; str_arr assoc_arr_str_typ; v_str VARCHAR2(200) := '1102,1101,1012,1011,1010,1009,1008,1007,1006,10005,1004,1003,1002,1001' ; v_token VARCHAR2(4) ; i PLS_INTEGER := 1 ; BEGIN LOOP v_token := get_token( v_str, i , ',') ; EXIT WHEN v_token IS NULL ; dbms_output.put_line( v_token ) ; str_arr(i) := v_token; i := i + 1 ; END LOOP ; END ; /
Published by: GG 24 March 2011 09:51
-
Simple question: how to divide the string into multiple lines concatenated?
Hi people,
Maybe it's an easy question.
How to split a string that is concatenated into multiple lines by using the SQL query?
ENTRY:
Delimiter = ', '.select 'AAA,BBB,CC,DDDD' as data from dual
Expected results:
I'm looking for something nice to feature "an opposite to «sys_connect_by_path»»data ------------ AAA BBB CCC DDDD
Thank you
Tomaswith t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual) -- end of sample data select REGEXP_SUBSTR (txt, '[^,]+', 1, level) from t connect by level <= length(regexp_replace(txt,'[^,]*'))+1 REGEXP_SUBSTR(TXT,'[^,]+',1,LE ------------------------------ aaaa bbbb cccc dddd eeee ffff
Maybe you are looking for
-
Where the smeg are my favorites?
I have installed and uninstalled Aurora yesterday and also improved in FF8. One, or a combination of these actions has deleted all my favorites. There are just two \Application Data\Mozilla\Firefox\Profiles\x0a3sceq.default\bookmarkbackups json files
-
Satellite P200D-139 - HARD drive upgrade options
I received a P200D-139 and there seem to be two 40GB hard drives. I want to upgrade if I put Windows 7 on it. I have updated the BIOS, so how big a drive can I put into each slot of the HARD drive? I'm also going to 4 GB of RAM. See you soon Gary1857
-
my safari browser crashes on all my devices (MacBook Pro / iPhone / iPad) strange and scary no work around have not yet
-
The NAS can be turned on without a disc?
Recently, I took a drive on the NAS that I intend to sell it. Before removing the disc (which is now used in another device), I forgot to put back the NAS to its factory settings to remove my information and data of the NAS. I assumed that the NAS sh
-
bad terminator in the Basler A504k CIM series
I'm talking about in series of LV to a Basler A504k via a NOR-1429th and, despite what says in the compatibility report and in this post, I perfectly managed, at least as long as I tried. A (still unpolished) example of my order that VI is attached (