SQL & PL/SQL :: Separate CSV Values In A Field?

Nov 6, 2012

create table nov06(
f_name varchar2(20),
l_name varchar2(50),
m_name varchar2(10)
)

insert into nov06 (l_name) values (aaa,bbb);

insert into nov06 (l_name) values (ddd,nnn,jr);

insert into nov06 (l_name) values (fff,mmm);

here the values in the l_name are seperated by ','.
comma seperated values represents "f_name,l_name,m_name".

I've to seperate the strings and put in their respective fields.

Quote:
e.g in second insert statement value (ddd,nnn,jr), so the values will be
f_name -> ddd
l_name -> nnn
m_name -> jr

how can I do it???

View 2 Replies


ADVERTISEMENT

Select Records With Same Values Of Field?

Oct 9, 2007

there are some data in the table que_history (seqnbr is the key), e.g.

SEQNBR DN SL_TIME
20070927003668 (024)2272 AD182040 2007-9-27 15:15:00
20070928001343 (024)2272 AD182040 2007-9-28 9:55:14
20070928001624 (024)2272 AD182040 2007-9-28 10:30:06
20070928000910 (024)25672 AD000002 2007-9-28 9:06:59
20070928001288 (024)25672 AD000002 2007-9-28 9:49:13
20070923003834 (024)2585 AD210076 2007-9-23 17:15:13
20070923003890 (024)2585 AD210076 2007-9-23 17:23:54
20071001001593 (024)2589 AD000018 2007-10-1 11:54:39
20071003002814 (024)2589 AD000018 2007-10-3 16:53:52
20070923003320 (024)8831 AD000110 2007-9-23 15:24:39

I wanted to use this SQL to get the records ( dn is the same and the sl_time's interval is 600minutes) .

select A.* from que_history A,que_history B
where A.dn=B.dn and A.seqnbr<>B.seqnbr
and (A.sl_time-B.sl_time)*24*60 between -600 and 600
order by A.dn;

but the result is not the right.

View 3 Replies View Related

Grabbing 2 Unique Values Based On A Field?

Nov 29, 2012

I have a list sample:

Order#Location VendorName
--------- --------- ------- -------
145646842 MLIQUID02T 368308 JOHNNEISHA
134962284 MLIQUID02T 368308 JERRY
141138899 MLIQUID02T 368308 CARLENA
5078916 MLIQUID02T 368308 DONNA

[code]....

What I'd like to do is run SQL that can create output where I get 2 records from each Location. Example:

Order#Location VendorName
--------- --------- ------- -------
145646842 MLIQUID02T 368308 JOHNNEISHA
134962284 MLIQUID02T 368308 JERRY
13999694 MLIQUID03T 368308 TINA
175439805 MLIQUID03T 368308 RANDI
4801973 MLIQUID05T 368308 DIANA
55907648 MLIQUID05T 368308 DESIREE

Personally, I don't need the top value(s), but it would be nice.I was trying a few routes with rownum, and I can get it to pull 1 set of pairs with a where location= condition, but I can't seem to successfully combine the two.

View 1 Replies View Related

SQL & PL/SQL :: Get Single Row From Multiple Duplicate Values Of One Field?

Sep 10, 2012

CREATE TABLE prim_tbl
(id NUMBER,--- id is not primary key here
description VARCHAR2(30));

INSERT ALL
INTO prim_tbl VALUES (1,'aad')
INTO prim_tbl VALUES (1,'aads')
INTO prim_tbl VALUES (2,'bb')
INTO prim_tbl VALUES (2,'cc')
INTO prim_tbl VALUES (2,'dd')
SELECT * FROM dual;

I want to select the ids only one time, i.e my output will have only two rows: one row with id as 1 and other row with id 2 whatever be the description.

desired output sample:

Quote:1, aad
2, bb

I used:
select distinct(id),description from prim_tbl;

but it did not give the required result.How can I get it??

View 6 Replies View Related

Forms :: Navigation When Changing Values In Field Oracle 10g

Nov 8, 2011

We are facing below issue in Oracle forms 10g( Rel 10.1.2.0.2) with Windows XP professional.Application server J2EE 10.1.2.0.2).

We have a multirecords block. After navigating to last record by clicking mouse in scroll bar and change values in a column by clicking mouse in column to change, cursor control is moving to some other record(where cursor is located previously) and current changed value it is showing as not fully validated.

Eg: We have columns like below in multirecords block

Security Price Date Price
--------------- ------ ----
1 1/1/2011 12.00
2 1/1/2011 16.00
3 1/1/2011 18.00
4 1/1/2011 19.00 (Last Record)

If am changing last records price to 20 then press tab key, cursor will be moved to second record and cursor will be highlighted in security 2. column price where we changed to 20 also not validated to show as 20.00 with 2 decimal format mask.Along with this we are getting below error message ' FRM-41008 - Undefined function key, press Ctrl + F1 for list of valid keys.After changing the price we are pressing the tab key only.

This occurs randomnly and when we querying more than 2000 records with multiple times.

View 1 Replies View Related

Find Situations Where Single Unique Value Of Field A Has Both Values Z AND X In B?

Feb 19, 2011

In literal terms, I'm interested in two fields, I'll call them Field A and Field B. I want to find all situations where a single unique value of Field A has both values Z AND X in Field B (not either or, but both together).

To go into some detail -

I need to make a query that finds ONLY occurrences where one employee id has a certain set of values together (without going into specifics, I'll say PermissionA, PermissionB, PermissionC). I can easily make a query that returns all user id's and all permissions belonging to them, and I can use criteria to filter the results to Permission A B and C only so as to exclude other permissions from getting returned (since there are hundreds),

however my objective is to get ONLY results where the same employee ID has all of those permissions (not just any one or two of the three). However, I don't want to have any criteria that limits the employee ID (I want to search all employee id's, and get a list of those with permissions a and b and c, not just any combination thereof, but all of them). I'm currently able to organize the output using a pivot table by employee id > role,

so that I can easily look at each employee and the roles they have, but I want to undertake a project that will involve searching a much larger number of employees (a # that makes it impractical for me to look through the list, I need to have a query that limits the results to the combinations that I'm looking for, as in this example - permission a b and c together).

View 1 Replies View Related

Application Express :: Dynamically Update A Number Field By Summing Of Page Item Values

Jun 28, 2012

I'm trying to update a number field on an apex page by summing up the values of multiple page items. I've tried to follow this tutorial

[URL]........

especially the "Create a Set Value Dynamic Action Using PL/SQL" part.

In the tutorial example they return an page item value P3_SAL multiplied by a multiplier they've determined by another page item's case. What I want to do is much simpler in that I just want to add up multiple page item values and then display them in a number field at the bottom of the page.

so the code I tried to use based on the tutorial is in the tab: Home >Application Builder>Application 103>Page 3>Edit Dynamic Action>Create / Edit Action

Set Type: PL/SQL Function Body

PL/SQL Function Body:

BEGIN
return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
END;

Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3

But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.

i.e.

BEGIN
return :P3_ITEM1+1000;
END;

View 2 Replies View Related

Server Utilities :: Field In Datafile Exceeds Maximum Length For Number Field?

Apr 23, 2010

Even though i am using COL1 CHAR(500) NULLIF COL1=BLANKS, then also i am getting same error for those columns.

View 13 Replies View Related

Forms :: Update Field Based On Another Field Checkbox

May 3, 2013

I have a table where i need to update one field values based on another field of the same table , simply as it is.I have done this using one select all check box , on clicking that all check boxes of item_trans table will get selected , then i will un select some of check box and then using one button, i will update the value of the fields which are checked only.

I have put the sample code but when i am updating its taking long time and hanging.I am also attaching the form based on the test case provided.

--tables with insert statement
create table item_trans (trans_item varchar2(12),trans_qty number,trans_act_qty number)

insert into item_trans(TRANS_ITEM,TRANS_QTY,TRANS_ACT_QTY) VALUES ('TREE1',40,NULL);
insert into item_trans(TRANS_ITEM,TRANS_QTY,TRANS_ACT_QTY) VALUES ('TREE2',20,NULL);
insert into item_trans(TRANS_ITEM,TRANS_QTY,TRANS_ACT_QTY) VALUES ('TREE3',20,NULL);

--i want to set the value of trans_Act_qty as trans_qty

--i create one dummy or test block to keep the select all check box. for that table test script is

CREATE TABLE TEST
(
C VARCHAR2(2000 BYTE),
B NUMBER,
A NUMBER
);

insert into test (C,B,A) values ('A',1,1);

--code written in select all check box which is created on test.block.

BEGIN
GO_BLOCK('item_trans');
FIRST_RECORD;
LOOP
:M_END_YN := :M_END_ALL;
[code].......

--code written in M_END_YN ( actual check boxes where i will uncheck).

IF :M_END_YN = 'N' THEN
:M_END_ALL := 'N';
END IF;

--code written on button to update those values which are checked.

BEGIN
GO_BLOCK('item_trans');
FIRST_RECORD;
LOOP
IF :M_END_YN = 'Y' THEN
[code]......

View 5 Replies View Related

How To Enable And Disable A Field Dependent On Another Field In Apex

May 9, 2013

I am New to Apex. Im using Apex Version 4.2.

I have a tab named APPROPRIATIONS it has 10 fields. Among which is PROJECT NUMBER, AUTHORIZAION DATE (CALENDER TYPE POPUP), And FUNDS CHECK FLAG.

The Scenario is depending upon PROJECT NUMBER the Fields are Populated including FUNDS CHECK FLAG .

But the AUTHORIZAION DATE is a MANDATORY field has to be filled by User

The Requirement is to make AUTHORIZAION DATE as MANDATORY only when the FUNDS CHECK FLAG is *"BLANK "* or *“Y”*

If the FUNDS CHECK FLAG is *“N”* then the AUTHORIZAION DATE to be made OPTIONAL.

View 2 Replies View Related

SQL & PL/SQL :: How To Eliminate And Separate String

Apr 29, 2011

In my table i have a field called swistmsg, which contains value as

:201:0001OTT11000004|:23b1:CRED|:32a1:01-01-2011|:32a2:USD|:
32a3:1000.|:33b1:USD(similarly around 100 rows)

and my requirement is

201 0001OTT11000004 23b1 CRED 32a1 01-01-2011 32a2 USD 32a3 1000 33b1 USD

and i have eliminate '.',':'&'|' (only quoted chars)from the string separate string

View 17 Replies View Related

SQL & PL/SQL :: Separate String Using REGEXP_SUBSTR

Jan 25, 2011

I can separate numbers from string (info) and the first value of the string using REGEXP_SUBSTR (see below):

with dat as (select '35263304 Alcatel One Touch 806' info from dual)
select info, REGEXP_SUBSTR ( info, '[[:digit:]]+',1 ) tac,
REGEXP_SUBSTR ( info, '[[:alpha:]]+',1) brand
from dat

But how can I get rest of the values from that string (red color) ?

I just would like to get separately like:
35263304 Alcatel One Touch 806

View 5 Replies View Related

SQL & PL/SQL :: Separate Date And Time

Nov 1, 2012

I have a question with Oracle sql developer, i've installed oracle 11g express edition, and i want to insert values 'date' and 'time', but i only got the resultat like this:

Who can tell me how can i do to show just date info in 'date' and same for the 'time'?

View 7 Replies View Related

RAC For Separate Node's Physical Location

Mar 21, 2012

I would like to implement Oracle RAC with 2 nodes for SE Licence. I did a lot when both this nodes with 3 NICs each were plugged at the same switch. Now I have a need to construct a RAC when two nodes will be in separate locations, abot 4 miles from each one. What should I explain to our network administrator he needs to do to implement this solution? I've been told that they can do a FO channel to each location. But don't have exact clear explicaton.

View 3 Replies View Related

SQL & PL/SQL :: Separate Index And Tables In Two Different Tablespace

Apr 14, 2013

How to saperate inndexes and tables in two different tablespcae.......???

View 2 Replies View Related

Forms :: Opening New Form In Separate Tab

Dec 18, 2011

I have a multiple forms application and I use OPEN_FORM to call one form from another. However I want the new form to open in a separate tab ( the way it works in a tabbed canvas).

View 4 Replies View Related

SQL & PL/SQL :: Separate String Based On Comma?

Oct 28, 2013

This I want TO separate TO different COLUMNS based ON comma.

THE RULE IS LIKE out OF total five fields FIRST 3 comma will be FIRST 3 addresses AND rest will be address4 AND LAST NUMBER should appear IN pincode field IF found.

The trouble is for reading reverse to get the number.

WITH address AS (SELECT 'Avenue Supermarts Pvt Ltd,Anjaneya, Opp Hiranandani Foundation School, Powai, Mumbai,Pin Code 400076' addr1 FROM dual UNION ALL
SELECT 'Plot No. J-I, Block B-I, Mohan Co-operative Industrial Area, Mathura Road, New Delhi-110044' addr1 FROM dual UNION ALL
SELECT 'Padmashree Arcade, NH 5, Chinagantiyda Main Road, Gajuwaka, Vishakhapatnam' addr1 FROM dual UNION ALL
SELECT 'The Icon, 2nd 3rd Floor, #8, 80 Feet Road, HAL III Stage, Indiranagar, Banglore-560075' addr1 FROM dual UNION ALL
SELECT '13/1, International Airport Road, Bettahalasur Post, Bengaluru-562157' addr1 FROM dual)
SELECT addr1 FROM address;

View 10 Replies View Related

SQL & PL/SQL :: Separate Date Interval By Trimester

Jul 26, 2011

Let's say I have this table:

create table TEST
(
CF VARCHAR2(16),
START_DATE DATE,
END_DATE DATE
)

with

insert into test (CF, START_DATE, END_DATE)
values ('ME', to_date('01-01-2011', 'dd-mm-yyyy'), to_date('31-12-2010', 'dd-mm-yyyy'));

I need make a select where I get n rows, where n is the number of trimesters that compose the date interval in the table. Each of the returned rows must have as start_date/end_date the boundaries of that trimester.(ALL start dates are the first day of a month, and all end dates are the last day of a month)

In this case I need to get:

ME - 01/01/2010 - 31/03/2010
ME - 01/04/2010 - 30/06/2010
ME - 01/07/2010 - 30/09/2010
ME - 01/10/2010 - 31/12/2010

View 9 Replies View Related

PL/SQL :: Separate Different Arithmetic Operators In A Query?

May 14, 2013

I wrote an query and regarding one part, i have syntax problem, when should we seperate different arithmetic operators in a query?

for example

select  density_with_desert.popp  /  density_with_desert.arr  -  sum(darea)  from counytyi don't want to use variables.

View 8 Replies View Related

Forms :: Separate Frame Applet

Mar 17, 2011

We are using oracle forms 10g, in formsweb.cfg file i gave separeteFrame=true and it works fine also like IE & applet window is opening. But User wants to hide the IE in backegroud and they want only applet window, so using VBScript we are hiding the IE and now only applet window apears this also fine.

I am running the report and displaying the report using web.show_document, report is running fine and displaying in IE with PDF format. But the problem is if i press the run report button report is opening and displaying behind the applet window not infront of applet window and there is no focus on the report IE also. How to display the report output(IE with PDF format) infront of the applet window and current focus on the report window(IE with PDF).

Note: If i use separateFrame=false then report is displaying infront of the IE screen and focus is on the report IE.

View 1 Replies View Related

Forms :: Fmx Files Into Separate Folder

Apr 29, 2013

I have some .fmb files in 'F: ask" " ' location.and my question is can i store the .Fmx files in other location like 'D:" " '

that is if i create a .fmx file for the 'F: ask**.fmb'. i want That .fmx file will store into other location i.e 'D '

View 3 Replies View Related

Return Separate Result Set From Each Statement

Jul 19, 2008

I am simply trying to execute a couple of select statements in a single dynamic query. I also want it to return a seperate result set from each statement (something quite easy in T-SQL - but seemingly impossible in PL-SQL!)

This query is being run from C#, but i also get the same results from Sql Developer.This is what i'm trying to execute:

begin
select * from studies;
select * from studyprogressions;
end;

The error i get is "an INTO clause is expected in this SELECT statement" for each of the select lines - As you may already have worked out - I don't use Oracle very often and am starting to feel very stupid considering i have certifications in SQL Server/T-SQL!

I have searched online for a solution, but it seems that everyone with the same error is trying to do so much more.Why is nothing in Oracle simple? Give me SQL Server any day of the week.

View 14 Replies View Related

Update Field With 1st 9 Characters Of Another Field In Same Record?

Apr 23, 2009

I need to update a field with the 1st 9 characters of another field in the same record.

View 1 Replies View Related

SQL & PL/SQL :: Updating A Date Field With Field From Another Table?

Nov 14, 2011

I have a table called Customer_Type with following fields

Customer_type ,Active_date, Inactive_date
regular,11/01/2011
daily,11/04/2011
monthly,11/05/2011/11/11/2011

Tbale 2:Customer

Customer_name,Customer_type,Customer_Inactive_date
John,regular,
James,monthly,
Jake,daily,
Jill,monthly

What i wnat is to update the Customer_inactive_date with the Incative_date field from Customer_type based on their Customer_type... So james and Jill would have their rows updated in this scneario ..How can i achive this in pl/Sql

I have teh code using merge function..I want something in traditional old fashion..

The sql statements are below

CREATE TABLE CUSTOMER_TYPE
(
type_code VARCHAR2(10),

[Code]....

View 5 Replies View Related

SQL & PL/SQL :: Make Query Like Separate List Of Orders

Mar 1, 2010

I have table called Orders with lots of fields from Imports Fields are ConsigneeKey,Shipto,ProductCode. and another table called Product. Main fields are ProductCode,Price,Weight,StdCube. Now I have two list of Consineekey,One which is shipto X area and another is of Y area. I want to make query like separate list of Orders which is shipto X,Y and Common Products in Both X and Y. I will supply list of Consigneekey in where clause.

View 8 Replies View Related

Separate ASM Diskgroup For Online Redo Logs

Sep 25, 2013

Version: 11.2.0.3Platform : Solaris 10   

One of  the Hitachi support guy has suggested to create a separate disk group for Online redo logs. His rationale was that ORLs was write only files and it would be better to put in a separate disk group.

View 6 Replies View Related

SQL & PL/SQL :: Fetch All Emails Of Employees And Separate Them By Semicolon

Aug 17, 2010

Need pl/sql block to fetch all the emails of all the employees from the database and separate them by semicolon....

View 4 Replies View Related

Archivelog Location In Separate Date Format

Nov 10, 2013

archive logs to be stored in its own "date formatted" separate folders.I have already configured flashrecovery area and I dont want to change it as backups are stored there.How can I achieve this without changing the flash recovery area location ? db_recovery_file_dest is set to G:log archive dest is set to F

View 8 Replies View Related

Create A Separate Sort Order Column On Table

Oct 31, 2006

I have data that i am sorting, the data is mostly numeric (format of XXX-1234). is there any way to have my query sort xxx-1000 AFTER xxx-999? right now i am thinking i will have to create a separate sort order column on my table.

View 2 Replies View Related

Separate Date Format For Specific Columns In A Database

May 25, 2011

As we know that date datatype can store both date part and time part. If I specify the Date format for my database as 'DD-MM-YYYY HH@$:MI:SS' can i ensure i anyways for a particular columns in the database containing date values the format is 'DD-MM-YYYY' i.e without the time part.Can we specify seperate date formats for specific columsn in database during table creation?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved