PL/SQL :: Oracle Sql Get Data After First Occurrence Of Hyphen
May 29, 2013I need oracle sql get data after first occurrence of hyphen.
source string:
abcd - efgh
I want everything after the "-"
I need oracle sql get data after first occurrence of hyphen.
source string:
abcd - efgh
I want everything after the "-"
I have a string like this .
'ABC-XYZ-MNO'
and i want the data in the below format
'ABC','XYZ','MNO'
I'm trying to find a way to see if a value occurs more than once in a string. I just need to know "T/F", or "Y/N", etc.
The string will be comma delimited.
String: '1,2,3,1'
Ans: "T"
String: '1,2,3,4'
Ans: "N"
They do need to match exactly. for instance
String: '1,2,3,1a'
Ans: "N"
Using some code I found on this site, I coded this but I'm sure there's a better way. Is there??
--Check for Duplicate combination row values
BEGIN
--Query will split the string into individual pieces.
--Group the pieces to see if any 2 rows are the same
--If no rows are the same then "no_data_found" exception is thrown
SELECT 'T'
INTO vResult
[Code]...
I am using regexp_replace function to replace the string between the double quotes with the first occurance but i am able to replace first occurance but I am not getting remaining string.
For example:
select REGEXP_replace('Parent.addChildByName("DS-Id of OAL(BROBA)")||parent.add("DS-Id of OAL(BROBA)")','["]:print:+:punct::print:*["]','XXXX') from DUAL
O/P: Parent.addChildByName(XXXX)
Expected O/P : Parent.addChildByName(XXXX)||parent.add("DS-Id of OAL(BROBA)")
My need is to locate an occurrence of symbols starting from "s." (non-capital letter), following by word (with any capital letter at the beginning) and ending with ", " (comma and space symbols).
Ex:
select 'jeklghje, s.Glkgje, u.slgjwek, 904869' as tt from dual union all
select 's.Tklgj, u.slgjwek, 23578, elslgjs' as tt from dual union all
select 's.klgj, u.ekgjes, 238573, dlsjkgj' as tt from dual
I'm looking for occurrence of "s.Glkgje, " and "s.Tklgj, ".
I think some combination of REGEXP_INSTR and REGEXP_SUBSTR should be useful, but I'm not familiar with these functions so good yet.
I have following data
WITH t AS
(
select 1 rn, 'A' val from dual UNION ALL
select 2 rn, 'A' val from dual UNION ALL
select 3 rn, 'B' val from dual UNION ALL
[Code]....
I need to calculate a new column "orderedRn" as
Rn Val OrderedRn
------------
1 A 1
2 A 1
3 B 2
4 C 3
5 C 3
6 C 3
7 A 4
8 A 4
9 B 5
10 B 5
version : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
i want to ,remove consecutive occurance from string
Example I/P: 'POWELL POWELL BRIAN K AND BONNIE POWELL JARRELL JARRELL'
to O/P : 'POWELL BRIAN K AND BONNIE POWELL JARRELL'I tried the below code is Working fine , But i wanted to do this using Regexp or Some other Better Method
WITH T
[Code]....
'm using the "Highlight Words" column formating for a report. There, I'm using the item syntax: &P1_RENVOI. Problem is, when the report appear, only the first occurence of the value of item "P1_RENVOI" is in red for every field in that column.
Is this a normal feature or should all occurences be put in red?
I need to search a specific pattern from a source code. In word, I need to check whether "getCode" has been called or not, for all the string inside double-quote("). Following are sample code lines -
1.->if(val==23){ month_desc = "a sample data"; }
2.->if(val==23){ month_desc = getCode("a sample data"); }
3.->if(val==23){ month_desc = "a " + getCode("sample data"); }
4.->if(val==23){ month_desc = getCode("sample data"); var2="sample data2";}
Now, expression should be such that it will return true during check for 1, 3 and 4, although, for 3 & 4 getCode has been called for part of the String.
I have this table :
column1 column2
--------- ---------
value1 value2
value1 value3
value2 value4
value3 value7
value7 value1
value8 value9
What I was trying to retrieve is something like that:
Quote:
output_column
---------------
value1, value2, value3, value4, value7
value8, value9
I don´t care about the order of the values in the row. In other words, I want to get disjoint sets of data connected by any of both values.Every pair in the input table is unique.
I have seen in the web that it is possible to do using connect by and hierarchical retrieving but I've been trying to make a lot of combinationts and I can reproduce the output.
I'm trying to add edmx file in my project for first time. I want to choose the oracle provider ODP.net but cannot find Oracle in the data source list. I have oracle 11g installed , odp and odt installed and can access it from the solution as well. I saw the Oracle listed under data source when I tried to connect the solution to the database through server explorer. The solution is connected to Oracle database through ODP.
View 8 Replies View RelatedI need to export only the data from schemas or tables, how to do that with Oracle Data Pump? when we use schemas parameter this export all schema, not only the data right?
View 7 Replies View RelatedI have set up a cross platform (Microsoft Windows IA (32-bit) -> Linux x86 64-bit) data guard and it worked fine.Then I did a switch over (which again worked) and found out the data is not getting replicated at all.. checked the data files available from the new primary database and found out they are in the windows format as below..
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
D:ORACLEAPPADMINISTRATORORADATAMFSSYSTEM01.DBF
D:ORACLEAPPADMINISTRATORORADATAMFSSYSAUX01.DBF
D:ORACLEAPPADMINISTRATORORADATAMFSUNDOTBS01.DBF
D:ORACLEAPPADMINISTRATORORADATAMFSUSERS01.DBF
D:ORACLEAPPADMINISTRATORORADATAMFSRMANRMAN_TS01.DBF
and physically they were created at '/home/app/oracle/product/11.2.0/db_1/dbs/' and as
D:ORACLEAPPADMINISTRATORORADATAMFSREDO02.LOG
D:ORACLEAPPADMINISTRATORORADATAMFSREDO03.LOG
D:ORACLEAPPADMINISTRATORORADATAMFSRMANRMAN_TS01.DBF
I have oracle 10g r2 on windows.
I know the way to get data from Oracle to csv. But how can we read the data from csv and insert into Oracle table using UTL_FILE package.
Log shipping stopped logging/shipping into the Standby Database in one of our Oracle Data Guard Servers about two month ago and there was no change carried out as at that time. The Data Guard has only one Standby database. I have been managing the log shipping and recovery manually.
View 1 Replies View RelatedI would like to know if it is possible to create an automated standby database disaster recovery and high-availability solution (like dataguard) using hp data protector on oracle?
View 5 Replies View Relatedi had a problem with ODI 11g while i was loading some ";" delimited file.
The record is this one:
Header
PIATTAFORMA; FUNZIONE; OPERAZIONE; SUB_OPERAZIONE; DESC_FUNZIONE; SYSTEM; SUBSYSTEM; DES_OPERAZIONE; PROGRESSIVO; TIPOLOGIA; COMMIT; LOGGATA; MOTIVO_ESCLUSIONE
Data
UCAMP-PWS;CDBXF001;;;Inquiry su GEBA;CD;BX;;;Lettura;NO;NO;Funzione senza dati cliente
The field DES_OPERAZIONE is empty for that set of records, but is not a problem cause is a description, my target table is created with all VARCHAR2 except for one field that is Number (PROGRESSIVO in the example) and in this case is empty too, still not a problem cause is not some key or other.
What's happens to me is that if i have the field DES_OPERAZIONE empty, the record will be not loaded but without any message of error or warning. I used the NVL on the field to say if empty then 'ND' but doesn't work. The strange thing is that if i leave empty the field before for example for him doesn't matter, if i use NVL on the field before it works. On teh field DES_OPERAZIONE not !
Send me sample data migration scripts to get knowledge on Data migration.
View 10 Replies View RelatedI have a long file in WORD as I try to load it in ORACLE quotes become periods, ex:
insert into mytab values ('myname, 26);
when i copy this and paste it in oRACLE (UNIX environment), it translates as insert into mytab values (.myname.,26)..does not recognize the quotes.
I tried copying from word to notepad to ORACLE same problem..
How can i convert my ms excel record into oracle records??
View 3 Replies View RelatedIn my project I am getting production dump for performance testing and I need to mask few columns with sensitive information.
How can I mask the data in Oracle?
can i modify oracle data dictionary
View 6 Replies View RelatedWe need to transfer data from oracle 10g to Oracle 9i in the following condition.
There will be two database server , one is online server where online user fill the form which is generated by java, spring , hibernate and using database 10 g. at day end i need to execute a process that transferring data from online server to offline server that is in oracle database 9i. This process is scheduled. Some security reason client do not kept this two database on same network. My challenge is that transfer data from online server to offline server with applying client security norms.I have option like:
1) Using Oracle replication method, creating materialized view on remote server , refreshing it at regular interval. but database connectivity is not contineous, should i go for that ?
2) Write java application on intermediate server where we write process to get the connection of this two database servers. From java application we call the procedure for selecting data from Oracle 10g and insert into oracle 9i database and using flag on both data to identified how many rows are transfered and how many remaining for trasfer.
We have requirement such that whenever stored procedure is executed, their resultant records has to be stored in excel file ( Just like an reports ).No third party tool or reporting tools are used.
is there any option in oracle (Stored procedure or built in packages ) which can create excel file with the resultant records.
how excel data import into oracle
View 1 Replies View Relatedhow to load a XL sheet data into oracleDB.
View 7 Replies View RelatedI want to insert excel data into Oracle.
Excel File Name : Product 01
Excel columns
File Send on 13/02/2011
Arrival Date Product Code Gate Pass Quantity Inpection
01/02/2011 00002 Y 2 Y
03/02/2011 00001 Y 10 Y
04/02/2011 00005 Y 14 Y 03/02/2011 00006 Y 74 Y
File Send on 14/02/2011
Arrival Date Product Code Gate Pass Quantity Inpection
01/02/2011 00002 Y 2 Y
03/02/2011 00001 Y 10 Y
04/02/2011 00005 Y 14 Y 03/02/2011 00006 Y 74 Y
---New Updated Data
05/02/2011 00002 Y 2 Y
06/02/2011 00001 Y 10 Y
05/02/2011 00005 Y 14 Y 05/02/2011 00006 Y 74 Y
I just want to insert data according to my structure But if again the same file send with updated data it will only update the new data because previous data is imported.
Oracle Structure
Arrival Date Date,
Product Code char(5),
Quantity Number
Now we are having 100+ sql queries and we making all those queries as procedures.after that we want to schedule those procedures and get data to export into excel file.
so we are planning to use utl_file to get data export excel. we may have rows of 30000 above.is it utl_file will be able upload all these rows into excel.any performance issue will come.
I have a XML data that needs to be stored in oracle table and it is read from a java application. what datatype will suit for XML storage varchar2 or CLOB. The length of XML will be less than 4000.
View 4 Replies View Relatedhow to find the data size in particular Table?Ex:I need find out the sh.sales table how much data size is loaded
View 3 Replies View Related