Sitemap

Amicuk Programming Answers

How to extract a string value from a varchar column

-0001-11-30   Views:0

Advertisement

Hi, I've a varchar2 column which has got xml data. I want to extract the value of some tag <test></test> I can't use EXTRACT as the column is not XMLTYPE. Please suggest.Hi, make a new temporary table table wirth columns as the same name as TA

Hi,
I've a varchar2 column which has got xml data. I want to extract the value of some tag <test></test>
I can't use EXTRACT as the column is not XMLTYPE.
Please suggest.

The replay answer
Advertisement
Hi,
make a new temporary table table wirth columns as the same name as TAGS in your XML.
extract the XML in a temporary variable.
pass it to the below proc with the table name created in step1 , it will populate the temporary table with the XML data.
PROCEDURE prc_save_xml(
iv_table_name IN VARCHAR2,
ic_xmlstring IN CLOB,
on_count OUT NUMBER,
ov_remarks OUT VARCHAR2,
ov_status OUT VARCHAR2,
iv_row_tag IN VARCHAR2 DEFAULT 'ROW'
) IS
insctx dbms_xmlsave.ctxtype;
doc CLOB;
BEGIN
--Get a context handle
insctx := dbms_xmlsave.newcontext(iv_table_name);
dbms_xmlsave.setdateformat(insctx, 'YYYYMMDD');
dbms_xmlsave.setrowtag(insctx, iv_row_tag);
ov_remarks := 'Inserting now';
on_count := dbms_xmlsave.insertxml(insctx, ic_xmlstring);
ov_remarks := 'Inserted now';
dbms_xmlsave.closecontext(insctx);
--set return status as Success
ov_remarks := 'Sucess';
ov_status := gv_success;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line('IN OTHERS :' || SQLERRM);
ov_status := gv_failure;
ov_remarks := ov_remarks || ':' || SQLERRM;
on_count := 0;
END prc_save_xml;

Go to See the other 11 answers

How to extract a string value from a varchar column

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I've a varchar2 column which has got xml data. I want to extract the value of some tag <test></test> I can't use EXTRACT as the column is not XMLTYPE. Please suggest.Hi, make a new temporary table table wirth columns as the same name as TA[More]

How to extract sub string value from a string?

Category:DefaultRelease time:2015-10-11Views:130

Hi, I need to know how can i extract sub strings from a main string, something like this: main variable-------->"2087-5E2SE-19-JG7BC" i want to split it into like this: sub_main_1 variable---------> "2087" sub_main_2 variable----[More]

Subject: extract the string before space

Category:DefaultRelease time:-0001-11-30Views:130

I have a string say "aquarium a". i want to extract the string appearing before the space and discard the string appearing after space. that is the resultant string required is "aquarium". any number of characters can appear after spac[More]

Data extraction from string

Category:DefaultRelease time:-0001-11-30Views:130

I'm trying to search a particular value in a string file. The string contains many parameters followed by their values and units. I want to identify and extract, as a number, the value of a particular parameter. The program will basically ask the use[More]

How can i extract data strings (temp. press. rel.hum etc) using a Virtual interface through an RS-232 connection​?

Category:DefaultRelease time:-0001-11-30Views:130

How can i extract data strings (temperature, pressure, relative humidity etc) using a Virtual interface through an RS-232 connection?Try this.  It is in LV 8.5. Note the double % in the format string.  This is so the % in the input string is treated[More]

Extract numeric string in string

Category:DefaultRelease time:-0001-11-30Views:130

I want to extract numeric string from astring. it should stop reading if it hits an alphabet that is requirement.it is not that numeric string is of fixed lenght but it will be in begining. example:78965rocksalt result:78965.Hi, use fm PREPARE_STRING[More]

Is this a proper way to check if a string exist in a db-column?

Category:DefaultRelease time:-0001-11-30Views:130

I don't know I am posting this in the right forum... anyway... I am trying to check if a string as an email address exist in a database with jsp (by returning true if the string exist). I have managed to do it but I am not sure if this is the best wa[More]

Select-String to search only first column in .CSV

Category:DefaultRelease time:-0001-11-30Views:130

Hello all, I'm wondering if anyone knows a way to only search the first column of a .CSV file using Select-String. I guess I could probably import-csv and pipe the first column to select-string, but I was wondering if Select-string has this capabilit[More]

How to get string (specified by line and column) from txt file with labview

Category:DefaultRelease time:-0001-11-30Views:130

Hi everyone How to get string (specified by line and column) from txt file with labview thx  Solved! Go to Solution.As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where word[More]

SQL Extract Variable String in Variable Position with Variable length from ntext field

Category:DefaultRelease time:-0001-11-30Views:130

i want to extract a variable string from an ntext field.  Sample Data in Background_text (ntext) function changeFocus()  {         document.getElementById('skipContent').style.visibility = 'visible';         document.getElementById('flashContent').bl[More]

Request help for Extracting CLOB String

Category:DefaultRelease time:-0001-11-30Views:130

Hi Everyone, I am getting the input string in the form of CLOB delimited by '~'. I have to tokenize the string and insert those values into the below table through procedure / function. Create table TEST_TEMP ( NUM NUMBER(10), NAME VARCHAR2(1000), DE[More]

Hot
I tried switching on an off and rebootingWhere did you get the iPad?  You can always follow this procedure http://support.apple.com/kb/HT1212 but it's kind of suspect that it has a password on it.    And this prompt occurs as soon as you turn the dev [More]
Hi! I've been using mac for about 3-4 years now and I am fairly acquainted with my Macbook pro. My problems surfaced 2 days ago when a friend of mine opened it up and changed the harddrive to this: http://www.overclockersclub.com/reviews/seagate_mome [More]
Can't crop pictures. Too slow. Both desktop and laptop are doing same thing. Rcently installed CS6 on two machines. All updates installed. No viruses detected. Laptop  - Windows 8/CS6 8GB RAM Desktop - Windows 7/CS6 8GB RAM When I crop a photo the ta [More]
Hey there, many month ago I switched from a Mac a year ago, and now I'm missing a good calendar (like iCal). Is there any known good one? Maya-calendar from eOS is the most similar I found, but not stable on my systems. Last edited by sonnenschein (2 [More]
When setting stage.fullScreenSourceRect, stage.displayState to StageDisplayState.FULL_SCREEN_INTERACTIVE; and renderMode to GPU, mouse position is read incorrectly. This is not only for mouseX and mouseY position, but also all the mouse interactions [More]
Is there a quick way to do that or do i need to note the size of each frame in InDesgin and then input that into the dialog in illustrator. It seems like a waste of time. Is there a better way? I am new to InDesgin. What I'd like is a way to automati [More]
One of our systems that is running Win XP Pro SP3 with InDesign CS4 loaded and file associations fixed, when an INDD file is double clicked the application opens but the file does not. If we open INDD and go to file open and select the file it opens. [More]
Hi, I am new to OBIEE, I installed OBIEE 11G in personal laptop and succesfully able to work on BI adminstration, but unable to open web logic console and other stuff which are web applications. I am getting error as cannot display page. Is there any [More]
Hi All, Could you please tell me your suggestions on below problem. We have three type of users ( "ADM", "READ", "READWRITE") I have created the sequence in ADM user and gave grant to read & " ReadWrite" users. [More]
alert<SID>.log file is abrubtly increasing in size which is in process filles up a disk space, hence further no DB login. I shutdown the database, took a bakup of the alert log file, nullified the alert log ( using cat /dev/null > alert.log) and [More]