SQL & PL/SQL :: Searching City Name From Address

Apr 16, 2010

I want to write a SQL statement to search valid city name from address field. Valid city names are in one table and address column is in another table.

View 5 Replies


ADVERTISEMENT

PL/SQL :: Get CITY And STATE From Address

Jul 9, 2013

I have got a table where the site address is stored as follows - 

SOUTH PARK ROAD #822,,,,
HOLLYWOOD,FL,33021,,
USPO BOX 1111,,,,
PHILADELPHIA,PA,19178-3478,,
USNORTH AVE EAST,
P.O. BOX 1234,,,ELIZABETH,NJ,07207-6031,,
US12345 PARK SORRENTO SUITE 222,,,,
CALABASAS,CA,91302,,US 

I have got 2 fields to be populated from this - CITYSTATE How can I pick up the 5th and 6th field separated by the comma.

For example: -

Following output should be shown for the above recordsCITY  
 
STATEHOLLYWOOD       FLPHILADELPHIA        PAELIZABETH       NJCALABASAS       CA

View 3 Replies View Related

SQL & PL/SQL :: Display Office Address / House Address And Emp ID In Single Query?

Feb 23, 2013

I have two tables emp , emp address as below

emp table :
emp_id emp_name,
1 rajesh
2 suresh

emp address table :

emp id emp_addresstype emp address
1 O kukatpally
1 H Hitech
2 O Kolkata
2 H hydar nagar

I need the query to display the Office address & House address & emp id in single query

ex: 1,Kukatally,hitech
2,kolkata,hydarnagr

View 3 Replies View Related

Forms :: How To Populate City Based On Selected State

May 14, 2010

I'am having a query regarding population of a list item based on another selected list item that is whenever i select the state from the combo box all the city's under that state should be automatically populated.

View 4 Replies View Related

SQL & PL/SQL :: Conditional Select - Query To Returns Results Based On Both City And Country Passed

Sep 17, 2010

Table A

Id Country city
1 US
2 US Boston
3 Boston
4 US Newyork
5 London
6 Japan Tokyo

Im looking for a query which returns results based on both city and country passed.

If i pass country US and city Boston it should return row2 with US and Boston row
If i pass country null and city Boston it should return row3
If i pass country UK and city Boston it should return row3
If i pass country UK and city London it should return row5

i.e. If country/city combination exists in DB return that row Else city row should be returned.

View 5 Replies View Related

SQL & PL/SQL :: Searching Collection For A Specific Value?

Oct 18, 2011

I need to check if a small collection contains a specific value. I know I can use the .exist method to let me know if the nth element exists. But is there a similar syntax for checking if an actual value exists?

So the below collection has 6 values (300,301,310,320,400,410) after the cursor values are fetched. I want to use something similar to the below exists syntax in order to search the collection for a value (rather than position) within an IF statement.

The below code shows the kind of thing I want to do. Currently, unless my test value (310) is in the range 1 to 6 the test will always return FALSE. But is there a similar syntax for testing against the value?

The example I have given is a simplification of what I need. In reality there will be more than one test value... returned by another cursor.

DECLARE
CURSOR c_type_id_usg
IS

[Code]....

-- get the list of sms type id usg values
OPEN c_type_id_usg;
FETCH c_type_id_usg bulk collect into l_type_ids;
CLOSE c_type_id_usg;

-- the above returns value 300,301,310,320,400,410

IF l_type_ids.exists(310)
then
dbms_output.put_line('I have found an entry ');
else
dbms_output.put_line('I have NOT found an entry ' );
end if;
END;

View 2 Replies View Related

SQL & PL/SQL :: Searching For A String In Whole Database

Aug 16, 2012

I've tried to write the procedure for search the string from whole database. If user give the string as an input the output will be tablename and column in which the string contained in the table,But it's showing an error .

CREATE OR REPLACE procedure sample.pr_search_table (p_search varchar )
is
type tb_type is table of varchar(30);
tb_table tb_type:= tb_type();
tb_column tb_type := tb_type();
v_temp varchar(30);
[code]...

View 6 Replies View Related

PL/SQL :: Searching String In A Table

Sep 9, 2013

I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production. 

I have a situation where I need to find the number of occurrences of a string that is present in a table having comma separated values. To explain with an example:  

create table test_data ( textfield varchar2(100)); 
insert into test_data values('DM,HM'); 
insert into test_data values('EM'); 
insert into test_data values('AM,CA,CD,FM,ST'); 
insert into test_data values('LS');
  insert into test_data values('TQ,SP,AM,FM,ST,CA,CD'); 
insert into test_data values('TQ,SP,AM,FM,ST,CA,CD,LS'); 
insert into test_data values('DM,HM,LS');

 The data in the table test_data looks like  DM,HMEMAM,CA,CD,FM,STLSTQ,SP,AM,FM,ST,CA,CDTQ,SP,AM,FM,ST,CA,CD,LSDM,HM,LS Now I need to search"LS" in the table test_data. Basically, I need to find if "LS" is present at least once in any of the rows or not. I want to avoid looping here. 

View 4 Replies View Related

SQL & PL/SQL :: Searching Numbers In Description Column?

Jun 15, 2010

I have two tables emp and dept

sql>select emp_id from emp;
emp_id
------
123
345
6782
32

[code].....

I would like to search all the employee id's which are present in description column of dept.

View 32 Replies View Related

SQL & PL/SQL :: Searching Data In Backup Tables

Apr 30, 2013

TEMP1--ORINIGAL TABLE NAME

DESC IS:

SNO NUMBER;
SNAME VARCHAR2(100);

BACK UP TABLES ARE

TEMP1_1;
TEMP1_2;
TEMP1_3;
.
.
.
.
.
TEMP1_10

IN THE ABOVE 11 TABLES SNAME COLUMN HAVING THE DATA AS 'NARESH'
IN SOME OF THE TABLES AND NOT IN OTHERS.

REQUIRMENT:

I WANT THE TABLES ONLY HAVING THE

SNAME COLUMN 'NARESH'.

View 7 Replies View Related

SQL & PL/SQL :: Use Of Index For Searching Data In Table

Mar 5, 2010

i want to know the use of index for searching data in table...tell answer to my query with table example....

View 2 Replies View Related

PL/SQL :: Searching Text Clobs From User_views?

Jul 22, 2013

I needed to search for some specific text in the DDL of each of the views in a particular schema. The text column of the user_views is LONG, and I looked at some old Tom's threads for converting long2clob, but found these processes to be really cumbersome, so I just opted to use DBMS_METADATA.GET_DDL instead even if it is a little slow.

One area I do not have a lot of experience with is searching clob fields. I tried this but not sure what would be the appropriate function to use for something like this:

SELECT *
FROM
(

[Code]....

WHERE contains(object_text, 'WHERE t.policy NOT LIKE') > 0; -- Show the names of all views that contain the matching text

View 4 Replies View Related

Tuning Searching Into Clob In Batch Operation?

Jul 3, 2012

My application runs a batch procedure weekly once for searching 'A_Text' from a column in Table1 in a clob column in Table2 and inserts accordingly into another Table3.

code snippet is like this -

---
CURSOR cr_sn
IS
SELECT serial_number

[Code]....

TABLE1 will have at least 1.1 Million rows but not significantly more than this.

This procedure takes 24+ hours to complete. I tried -

1. putting parallel hint ( INSERT /*+ PARALLEL*/INTO Table3)

2. partitioning TABLE2 based on last_update_date and putting a where clause in the above query last_update_date ( last_update_date between date1 and date2)

View 3 Replies View Related

Forms :: Creating Searching Tool Using Oracle 6i?

Nov 26, 2012

I have created searching tool using oracle forms 6i. while searching the cursor move from text field (A) to other block query the data according to the field (A) and come back again to field (A). Everything is working fine but the problem is, when the cursor move back to the field (A) the existing text is highlighted and when user right something in it. It's overwriting the existing text.

I want when the cursor moving bank to the field (A) the text should not be highlighted and when the user writes something that will be added to the existing text.

View 1 Replies View Related

SQL & PL/SQL :: Insert Using String Matches / Matching And Searching Match

Jul 3, 2012

i have three tables ot_cut_head,ot_cut_det and om_mc_master based on which fourth table ot_cut_opr and fifth table ot_cut_mc must get populated , Conditions are as follows

first one is based on job_no in ot_cut_head the selection criteria will be filtered,if the job number is like '%M' then type MISC will be chosen ,if job number is '%G' then GRAT TYPE will be picked from om_mc_master (Machine Master) and operations and machines based on this will be filtered.

Second all the cd_ps_desc will be taken from ot_cut_det and will be compared with om_mc_master to get their corresponding operation codes and machine codes , there can be 2 operations or 1 operation.

Finally if the match is found record will be inserted into ot_cut_opr and ot_cut_mc ,based on the criterias and what i want is the search criteria to be more flexible and if there are 2 operations 2 rows will be inserted and if one opeation is defined in om_mc_master ,then only one record will be inserted.

We have to make sure that if based on operation number stage will be populated ,if its first operation then stage will be 1 and if its second operation the stage will be 2.like previous operation also depends on them , the second operation will have the previous operation as first operation and so on.

CREATE TABLE om_mc_master ( mc_type VARCHAR2(12),mc_prof VARCHAR2(30),mc_prep_cd1 VARCHAR2(30),mc_mach_cd1 VARCHAR2
(30),mc_prep_cd2 VARCHAR2(30),mc_mach_cd2 VARCHAR2(30));
INSERT INTO OM_MC_MASTER VALUES ('MISC','TEE SCH','IR','HO','RE','HO');
insert into om_mc_master values('MISC','Vertical Brace','R','HM','I','HO');
insert into om_mc_master values('MISC','Pipe','IR','HO',NULL,NULL);
INSERT INTO OM_MC_MASTER VALUES ('GRAT','PL','RE','HO',NULL,NULL);
SQL> SELECT * FROM OM_MC_MASTER;
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Searching PRODUCT Column Based Upon User Input?

Apr 30, 2010

I have table in Oracle with one column PRODUCT. Column PRODUCT have following values -

Account Management
Active Directory
Adobe Acrobat Reader
NT Account
Application Security

[code]....

I am designing application where I need to search for PRODUCT based upon user's input. Lets say user wants search on 'Laptop Account Broken'. I want to search for all products which contains any of words in user's input. So based upon user's input I want output like below.

Expected Output:

Account Management
NT Account
WebSite Account
HP Laptop

View 2 Replies View Related

Stored Procedure For Searching Data From A Table By Passing Tablename As A Parameter

Feb 6, 2012

This procedure is not working properly.

create or replace procedure bank_search_sp
(
p_tablename in varchar2,
p_searchname in varchar2,
p_bankcode out varchar2,
p_bankname out varchar2,
p_dist_code out number
)
as
v_tem varchar2(5000);
begin
v_tem :='select bankcode,bankname,dist_code from ' || UPPER (p_tablename) || '
where bankname like '''|| p_searchname||'';
execute immediate v_tem into p_bankcode,p_bankname,p_dist_code using p_searchname ;
commit;
end bank_search_sp;

the Procedure is getting created but i dont know what actually happens when it was executed ,This is the error shown..ORA-01756: quoted string not properly terminated

ORA-06512: at "PENSIONS.BANK_SEARCH_SP", line 14
ORA-06512: at line 1

View 1 Replies View Related

SQL & PL/SQL :: How To Get Email Address From Xml

Dec 27, 2011

I want to know how can I find/take from In parameter who is xmltype an email address ?

My function: (clob is cast to xmltype)

function submit(session_id in number, claim in clob) return xmltype

For example - I have more e-mail addresses in this:

<emails>
wtfn00b1@yahoo.com
wtfn00b2@inbox.com
wtfn00b3@mail.com
...
</emails>

I know that there is `extract` function for xml. How can I know if there is break or space between the emails ?

View 9 Replies View Related

Forms :: How To Get IP Address In 6i

Dec 31, 2012

How to get ip address in forms 6i ?

View 6 Replies View Related

Parsing Address And Name

Jan 25, 2012

I intend to write procedures/functions in PL/SQL to parse Name field into various fields : Title, FirstName, MiddleName, LastName, Gender.

E.g:
Nguyen Van A
Nguyen Thi B

After parsing, the result will be shown as:

TitleFirstNameMiddleNameLastNameGender
MrNguyenVanAMale
MsNguyenThiBFemale

 Parsed.gif ( 4.94K )
Number of downloads: 2

I supposed that Title & Gender are realized through MiddleName field. If MiddleName's values in (Thi, Dieu) then Title is assigned as Ms, and Gender = "F". Otherwise, Title = "Mr", and Gender = "M".

2/ Another procedure/function is [i]ParseAddress with the requirement as:[/i]Address field is divided into Street, Group, Area, Ward, County fields
E.g.:No 6 Sum Street - Group 8 - Area 2 - ABCD Ward - London

The result:

StreetGroupArea Ward County
No 6 Sum StreetGroup 8Area 2ABCD London

I have tried coding by Visual Basic, it is OK. But if I interpret to PL/SQL ->it doesn't work.

View 1 Replies View Related

SQL & PL/SQL :: Parsing Name And Address?

Jan 25, 2012

I intend to write procedures/functions in PL/SQL to parse Name

field into various fields : Title, FirstName, MiddleName, LastName, Gender
E.g:
Nguyen Van A
Nguyen Thi B

After parsing, the result will be shown as:

TitleFirstNameMiddleNameLastNameGender
MrNguyenVanAMale
MsNguyenThiBFemale

I supposed that Title & Gender are realized through MiddleName field. If MiddleName's values in (Thi, Dieu) then Title is assigned as Ms, and Gender =

Female. Otherwise, Title = "Mr", and Gender = "Male".

2/ Another procedure/function is ParseAddress with the

requirement as:

Address field is divided into Street, Group, Area, Ward, County fields
E.g.:
No 6 Sum Street - Group 8 - Area 2 - ABCD Ward - London

The result:

StreetGroupAreaWardCounty No 6 Sum StreetGroup 8Area 2ABCDLondon

I have tried coding by Visual Basic, it is OK. But if I interpret to PL/SQL ->

it doesn't work.

View 3 Replies View Related

Getting Name In Email Address (Oracle SQL Plus)

Nov 6, 2007

How do I select the name in an email address. I would like to be able to order a list of email addresses by the name of the person ie. what comes before the @ sign.

So is there a query I could use to get everything before the at line . So in pseudocode I would need to be able to do something like this.

select substr(email, indexOf(@)+1,email.length) from table order by email

So I how could I go about doing that?

View 2 Replies View Related

Forms :: How To Get Client IP Address

Feb 15, 2010

method to get the ip address of Client machine using oracle forms .

I am using Oracle forms 6i and application server 9i.

View 9 Replies View Related

Forms :: Get Client IP Address Using 10g Rel.2?

May 2, 2011

how i can get Client IP address using Forms 10g Rel.2 and if other useful information i can get, how is it possible? is there any other solution if not using WebUtils ?

View 2 Replies View Related

Forms :: How To Get User IP Address

Jun 13, 2012

I'm trying to get client IP Address and show it to the user. I'm using forms 10g, with application server under UNIX.

View 1 Replies View Related

SQL & PL/SQL :: Concatenating Address Fields

Oct 28, 2013

The pipe separator needs to appear only when values found in addr1 or addr2 or addr3.

WITH address AS (SELECT 'Silver Arc Plaza,' addr1,'4th Floor, 20/1, New Palasia' addr2,'Indore' addr3 FROM dual UNION ALL
SELECT 'Shop No. 1,Vishnu Priya Building,' addr1,'' addr2,'pune' addr3 FROM dual UNION ALL
SELECT 'D/7, Siddhivinayak Nagari,' addr1,'Nr. Majura Gate, Ghod dod Road,' addr2,'' addr3 FROM dual UNION ALL
SELECT '' addr1,'B 4, Gold Coin Complex,' addr2,'Ahmedabad' addr3 FROM dual UNION ALL
SELECT '' addr1,'' addr2,'' addr3 FROM dual)
select addr1||'|'||addr2||'|'||addr3 address from address;

View 18 Replies View Related

SQL & PL/SQL :: Mac Address Finding Using Oracle

Sep 26, 2011

we can find the IP address in V$session table. Is it possible to find the mac address of user's computer?

View 13 Replies View Related

SQL & PL/SQL :: Right Way To Store IPV4 And MAC Address

Jan 26, 2012

The title for this new topic is self explanatory. Since PostgreSQL has data types for storing IPV4 and MAC address and Oracle don't, I would like to know the right way to store this values so we can do different operations and validations with these network address.

I been doing some research but I don't like the solutions like storing just number values whit out any validations like PostgreSQL.

View 4 Replies View Related

Forms :: IP Address Validation

Feb 18, 2007

Has any one written the validation code for

IP Address...

i.e it should be any thing from 0.0.0.0 to 255.255.255.255

View 6 Replies View Related

Capture IP Address In DB Trigger?

Mar 22, 2013

I am running 11.2. Within a DB trigger, I need to capture the IP address of the client making the change. I see there is a SYS_CONTEXT('USERENV','IP_ADDRESS') built in. Is this the correct way to capture the IP of the client making the change?

View 2 Replies View Related







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