Solved

Oracle 8i forms stack canvas searching error

Posted on 2007-03-29
6
669 Views
Last Modified: 2013-12-19
How are you,
  Hope every one fine, and enjoy health. Today I brought another headache in oracle 8i, hope you solve it because of vast experience.
  My question is simple and straight forward.
Q: I create one block know as search_block_form and another stack known as search_record (based on view). I create three item fields in search_block_form which are given below:
1)      Description varchar2 (100) contains area codes like Islamabad.
2)      Name varchar2 (50) contains name like Farhan
3)      Phone number (8) contains phone numbers like 879456

And in search_record stack canvas, I create view which has following fields:
1)      Name
2)      Phone
3)      Description
4)      Area hint

This means there are two data blocks one has search_form_block and other has search_record. I double click on search_record(Property Pallete) and goes from where clause and write this sricpt.
phone=:search_form_block.phone OR Upper(sub_name) like Upper(:search_form_block.sub_name)||'%'
According to this script, if you write name (full or partial) they search record in stack canvas means in search_record form or block.

 BUT there is some problem, like if you write phone number in search_block_form they show all records present in view, not specific one. And my other question is, i want to add description must, so that I ensure that phone or name viewed according to description.
For this I give simple example: there are two cities like new York and Manchester.
In your database there will be name and phone numbers of employees who lived in Manchester and some lived in new york

Manchester      New york
Elwin , 57-7854-58      Elwin khan, 9876-874-85
Hares, 789-874-852      Haik, 9876-852-3214

According to this table, there will be some employees name same, if you write name of elwin is in search_block_form, they show both cities employees, but I want that I print only those employees who live in specific cities along with other information which I mention above.
 I am waiting for you reply, please give me reply as sooon as possible.
          Farahn Khan


0
Comment
Question by:farhan786
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
Helena Marková earned 250 total points
ID: 18821740
I think that you have to modify default_where property of search_record block according searching criteria of search_form_block. It can be done in Pre-Query trigger of search_record block. In the Forms on-line help you can read more about Pre-Query trigger and also find useful examples.

By the way this condition
phone=:search_form_block.phone OR Upper(sub_name) like Upper(:search_form_block.sub_name)||'%'
is causing the problem "if you write phone number in search_block_form they show all records present in view, not specific one". If it will be
phone=:search_form_block.phone - you will receive only search number.

If there is only Name, the condition will be
Upper(sub_name) like Upper(:search_form_block.sub_name)||'%'
etc.

So you can see that there is need of modification default_where block property.
0
 
LVL 12

Assisted Solution

by:jwahl
jwahl earned 250 total points
ID: 18821757
the wildcard (%) in :search_form_block.sub_name) may also cause troubles: if you leave it blank, ALL sub_names will match the criteria ...
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 19322147
I think that you can split points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't Access My Database 57 88
Sybase and replication server 13 61
ORA-02288: invalid OPEN mode 2 89
oracle query 3 27
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question