-
I am trying to create a simple form that has a Text Item to accept a "Company Name" (varchar2) and a Push Button to fire a Trigger.
I would like my Trigger to query my database and return all records containing the "Company Name" in the appropriate column.
Here is my Trigger code: (FYI: my Block is called search)
DECLARE
query_name ia_entity_search.company_name%TYPE;
CURSOR search_name_cur (comp_name ia_entity_search.company_name%TYPE) IS
SELECT company_code, company_name, search_names
FROM ia_entity_search
WHERE ia_entity_search.company_name LIKE comp_name;
BEGIN
-- I've tried building query_name multiple ways...
-- query_name := ' '' ' || :search.company_name || '%' || ' '' ';
query_name := chr(39) || :search.company_name || '%' || chr(39);
FOR curr_search_name IN search_name_cur(query_name) LOOP
MESSAGE('company name: ' || curr_search_name.company_name);
END LOOP;
END;
I believe that this never enters my CURSOR loop because of my WHERE clause. I believe this has something to do with the way I am handling my varchar2 (comp_name).
Any suggestions?
The version of Forms I am using is:
Forms [32 Bit] Version 4.5.7.1.6 (Production)
Thank you.
-
Try this,
Replace
query_name := chr(39) || :search.company_name || '%' || chr(39);
to
query_name := :search.company_name || '%';
-
Originally posted by silasmw
Replace
query_name := chr(39) || :search.company_name || '%' || chr(39);
to
query_name := :search.company_name || '%';
Bravo!
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|