Problem with one time where clause

Hi All,
I am working with Oracle Forms 10g.
I have developed A new custom with Find window in that form. When we open the form First the find window will come first, and i have 10 fields in that form. For example PO number, supplier name,supplier site etc. When the user give po number and click find button in the find window it will move to my main form and query that po. If the user simply click find button all the po will listed. If the user give the supplier name alone and click find it will open the main form and query that supplier listed po alone. All working fine.
Now i need to refresh the my page when it moves from find window to my main window. So i use Execute_query built in.But when i use Execute_query when i give single po alone and click find it querying all the po in my custom table. So i used onetime_where clause.
But i dont know How to give more than one field in the onetime_where clause.
This is my syntax and its not working in my scenario
set_block_property('QUERY_FIND_BLK',ONETIME_WHERE,'C_PO_NUMBER='||:QUERY_FIND_BLK.C_PO_NUMBER);
go_block('BANK_GUARANTEE_BLK');
execute_query;
So i tried by different
set_block_property('QUERY_FIND_BLK',ONETIME_WHERE,
'C_PO_NUMBER || C_PROJECT_ID || C_SUPPLIER_NAME || C_SUPPLIER_SITE_NAME || C_GUARANTEE_NUMBER
|| C_APPROVAL_STATUS || C_BG_TYPE AND C_BANK_NAME || C_BANK_BRANCH_NAME || C_GUAR_ISSUE_DATE || C_GUAR_ISSUE_DATE='
|| nvl(:QUERY_FIND_BLK.C_PO_NUMBER , :QUERY_FIND_BLK.C_PO_NUMBER )
|| nvl(:QUERY_FIND_BLK.C_PROJECT_NAME,:QUERY_FIND_BLK.C_PROJECT_NAME)
|| nvl(:QUERY_FIND_BLK.C_SUPPLIER_SITE,:QUERY_FIND_BLK.C_SUPPLIER_SITE)
|| nvl(:QUERY_FIND_BLK.C_SUPPLIER_SITE,:QUERY_FIND_BLK.C_SUPPLIER_SITE)
|| nvl(:QUERY_FIND_BLK.C_GUARANTEE_NO,:QUERY_FIND_BLK.C_GUARANTEE_NO)
|| nvl(:QUERY_FIND_BLK.C_APPROVAL_STATUS,:QUERY_FIND_BLK.C_APPROVAL_STATUS)
|| nvl(:QUERY_FIND_BLK.C_GUARANTEE_TYPE,:QUERY_FIND_BLK.C_GUARANTEE_TYPE)
|| nvl(:QUERY_FIND_BLK.C_BANK_NAME,:QUERY_FIND_BLK.C_BANK_NAME)
|| nvl(:QUERY_FIND_BLK.C_BRANCH_NAME,:QUERY_FIND_BLK.C_BRANCH_NAME)
|| nvl(:QUERY_FIND_BLK.C_FROM_DATE,:QUERY_FIND_BLK.C_FROM_DATE)
|| nvl(:QUERY_FIND_BLK.C_TO_DATE,:QUERY_FIND_BLK.C_TO_DATE));
go_block('BANK_GUARANTEE_BLK');
execute_query;
But now again its querying all the records when i give a single po number in the query window.
Can any one tell that how to use this onetime_where clause with multiple parameter
Regards
Srikkanth

Hi Srikkanth,
Try out below logic.
PROCEDURE FIND_DETAILS IS
V_WHERE VARCHAR2(2000);
BEGIN
V_WHERE := ' 1=1 ';
IF :FIND_BLK.JOB_NUMBER IS NOT NULL THEN
V_WHERE := V_WHERE || ' AND UPPER(JOB_NAME) LIKE '''||UPPER(:FIND_BLK.JOB_NUMBER) ||'''';
END IF;
IF :FIND_BLK.JOB_STATUS IS NOT NULL THEN
V_WHERE := V_WHERE || ' AND STATUS_TYPE IN (SELECT lookup_code FROM mfg_lookups
WHERE lookup_type = ''WIP_JOB_STATUS''
AND UPPER(meaning) LIKE '''||UPPER(:FIND_BLK.JOB_STATUS)||''')';
END IF;
IF :FIND_BLK.WIP_CLASS IS NOT NULL THEN
V_WHERE := V_WHERE || ' AND UPPER(WIP_CLASS_CODE) LIKE '''||UPPER(:FIND_BLK.WIP_CLASS)||'''';
END IF;
IF :FIND_BLK.ORG_CODE IS NOT NULL THEN
V_WHERE := V_WHERE || ' AND ORG_ID = ' || :FIND_BLK.ORGANIZATION_ID;
END IF;
SET_BLOCK_PROPERTY('BLOCK_NAME',DEFAULT_WHERE,V_WHERE);
GO_BLOCK('BLOCK_NAME');
EXECUTE_QUERY;
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.SET_STRING('Unable to Match Search Criteria');
FND_MESSAGE.SHOW;
END;
By using above where clause you can also do wild search e.g. C_PO_NUMBER like '%323' etc.
Regards,
Nisarg

Similar Messages

  • How to call a form with dabble clicking on a record with one time where

    Hi All,
    How to call a form with dabble clicking on a record with one time where clause. I mean when i dabble click on the current record i want to call another form with details of the
    record with onetime where clause. Can anyone help me in this regard.
    Now i am calling a form with parameter with onetime where but this should avoid.
    Thanks in advance
    Arif

    Hello,
    I mistakenly mark it as solved. There is a problem remain. when i placed the code below it do not execute with the where condition. I mean the condition to execute is not work.
    All records executes. Please correct my code--
    Here the WHEN-BUTTON-PRESSED-trigger on the Edit-Button:
    :GLOBAL.MODE:='EDIT';
    :GLOBAL.REQ_ID:=:PROBLEM_REQUEST.REQ_ID;
    CALL_FORM('REQUEST_ID_PARAM',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY);And also, WHEN-NEW-FORM-INSTANCE-trigger of REQUEST_ID_PARAM:
    DEFAULT_VALUE(NULL, 'GLOBAL.MODE');
    DEFAULT_VALUE(NULL, 'GLOBAL.REQ_ID');
    IF :GLOBAL.MODE='EDIT' THEN
    GO_BLOCK('PROBLEM_REQUEST');
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('PROBLEM_REQUEST', INSERT_ALLOWED, PROPERTY_FALSE);
    END IF;Arif

  • One-time Where clause

    Hi,
    I read about the one-time where clause from oracle9i docs.I understand that it can be used as an alternative to a pre-query trigger.
    If this property is set at the runtime, in what trigger it has to be set using set_block_property? And how is the built-in referenced?
    Or is it something which happens in the background?
    Thanks
    Sheba

    Sheba,
    check the online help for set_block_property --> Onetime Where Property. It provides examples too.
    Frank

  • Problem with SYS_CONTEXT in WHERE clause in 10g

    I am running the following SELECT statement in 9i and 10g
    SELECT COUNT(*)
    FROM mapinfo.mapinfo_mapcatalog
    WHERE tablename IN ('ESU_GRAPHICS', 'STREETS', 'ASD_STREETS', 'NSG_ARCHIVE_ESU_GRAPHICS')
    AND ownername = sys_context('USERENV','CURRENT_SCHEMA');
    When running in 9i it returns 4, the correct answer, but in 10g it always returns 0. I have tried populating a variable with the result from sys_context('USERENV','CURRENT_SCHEMA') such as:
    SELECT sys_context('USERENV','CURRENT_SCHEMA')
    INTO currentschema
    FROM dual;
    I have checked the variable and it is giving me the correct result in 10g, but I still get 0 returned from the select statement.
    What am I missing to get this working in 10g?
    Cheers
    Sean

    - Does the value for CURRENT_SCHEMA actually match
    the ownername column for the tables in your IN
    clause? Yes
    >
    - Is there anything different between 9i and 10g?
    E.g. did you have any fine grained access control?Not that I know of, but I am not a DBA so I could not say for sure.
    Were you setting CURRENT_SCHEMA with an ALTER SESSION
    statement in 9i that you have missed in your 10g
    environment?No we do not use any ALTER SESSION statements.
    >
    - What do you get if you run the following?
    select user from dual;
    select sys_context('USERENV','CURRENT_SCHEMA') from
    dual;
    Exactly the same result
    >
    - What do you get if you run the following?
    SELECT tablename, ownername FROM
    mapinfo.mapinfo_mapcatalog
    WHERE tablename IN ('ESU_GRAPHICS', 'STREETS',
    'ASD_STREETS', 'NSG_ARCHIVE_ESU_GRAPHICS');
    380 rows of data including the 4 that I am interested in
    - Can you also show the value of your variable when
    you use a SELECT INTO in PL/SQL... Were you using
    uppercase for USERENV and CURRENT_SCHEMA in PL/SQL
    (there was an incorrect results bug when using
    lowercase attributes in PL/SQL SYS_CONTEXT calls)?I am showing the value of the variable and it is holding the correct value, and yes I am using uppercase USERENV and CURRENT_SCHEMA.
    After more investigation it looks like it is not SYS_CONTEXT, it is using a variable in the WHERE clause. If I set the variable to a hard coded value I still get the same result. If I replace the variable for a hard-coded string in the WHERE clause I get the correct result.

  • DME File Problem with One Time Vendor

    Hi SAP Gurus,
    I created a payment method Y and assign RFFOM100 and used this to do postings for one time vendors.
    Then I ran automatic payment  for One Time Vendors, pertaining to 5 different vendors. Payment run was successful, however the DME file generated shows 5 payments but all payments shows 1 single payee name..
    Is there any configurations that I might have missed?
    Appreciate your assistance.

    Need assistance

  • Cardinality estimator 2014 is off with OR in where clause

    Here is my test setup on SQL Server 2014.
    -- Create big table
    CREATE TABLE [dbo].[Store](
    Id int IDENTITY(1,1) NOT NULL,
    City int NOT NULL,
    Size int NOT NULL,
    Name varchar(max) NULL,
    CONSTRAINT [PK_Store] PRIMARY KEY CLUSTERED ([Id] ASC)
    GO
    CREATE NONCLUSTERED INDEX [IX_Store] ON [dbo].[Store] (City ASC, Size ASC)
    GO
    -- Fill with 100k rows
    INSERT Store
    SELECT i % 101, i % 11, 'Store ' + CAST(i AS VARCHAR)
    FROM
    (SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY s1.[object_id]) AS i
    FROM sys.all_objects s1, sys.all_objects s2) numbers
    GO
    -- Create small table
    CREATE TABLE #StoreRequest (City int NOT NULL, Size int NOT NULL)
    GO
    INSERT #StoreRequest values (55, 1)
    INSERT #StoreRequest values (66, 2)
    Now I execute the following query (I force the index to show statistics estimates)
    SELECT s.City
    FROM #StoreRequest AS r
    INNER JOIN Store AS s WITH(INDEX(IX_Store), FORCESEEK)
    ON s.City = r.City AND s.Size = r.Size
    WHERE s.Size <> 1 OR r.City <> 55
    Here are the estimates that I get (I'm not allowed to upload pictures):
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 50000
    Fixing WHERE clause to use one table not two makes the estimate perfect:
    SELECT s.City
    FROM #StoreRequest AS r
    INNER JOIN Store AS s WITH(INDEX(IX_Store), FORCESEEK)
    ON s.City = r.City AND s.Size = r.Size
    WHERE s.Size <> 1 OR s.City <> 55
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 89.74
    Switching to 2012 compatibility mode gives estimate of 1 in both cases:
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 1
    Could anyone explain the first result? I'm a bit worried about it. The fix in this case is trivial, but this problem gave us quite some headache in more complex real life queries with multiple joins.
    Thank you!

    But not full statistics on a field basis, just sometimes some default stats like total row count that some plans will build.  Even your StoreRequest table only has one two-field index that will have a full histogram.
    But I've seen SQL Server make massively bad plans on two-field indexes.
    I've seen SQL Server go wrong one-column indexes, so that is not a very relevant point.
    Temp tables or not, the estimate here is clearly incorrect. SQL Server knows the density of Size and City. It knows the cardinality of the temp table. The density information gives how many rows the the join will produce. The WHERE clause will then remove
    a certain number of rows. With no statistics for the temp table, it does not now how many, but it will apply some standard guess.
    50000 is a completely bogus number, because the join cannot produce that many rows, and SQL Server is able to compute the join with out the WHERE clause decently. (Well, it estimates 90, when the number is 180.) No, this is obviously a case of the cardinality
    estimator giving up completely.
    It is worth noting that both these WHERE clauses gives reasonable estimates:
     WHERE r.Size <> 11 OR r.City <> 550
     WHERE s.Size <> 11 OR s.City <> 550
    Whereas these two gives the spooky 50000:
     WHERE s.Size <> 11 OR r.City <> 550
     WHERE r.Size <> 11 OR s.City <> 550
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Pages 08 fonts- problems with Arial, Times New Roman - how do I repair them?

    Pages 08 fonts- problems with Arial, Times New Roman - how do I repair them?
    Using 10.6.8 on MacBook Pro
    Mikeaaa

    I am running Snow Leopard. Transferring the same texts to TextEdit has no problems, so this is a Pages problem, I think.  Corruption of Times New Roman and Arial fonts, I suspect, but where? and what do I do about it? I just need to be pointed to a source of advice, I think.
    Thanks
    Mikeaaa

  • TS3276 I have recently had a problem with one of my hotmail accounts, some sort of virus sending random emails to people in my address book. Hotmail advised me to change my password for that account, which I did. Why won't mail recognise the new password?

    I have recently had a problem with one of my hotmail accounts, some sort of virus sending random emails from my address book. Hotmail advised me to delete all contacts and change the password for that account, which I did on my laptop running windows XP. The change was successful and I was able to send and receive emails with no problem. I then had to change the account password on my iPhone 4s, which I did and it too was successful but when I came to change the password on my iMac, running the latest version of Lion it would not recognise the new password. I have tried to remove the account details and re-install but every time I go to add new account my old details are in the box. This is very frustrating as I use my iMac for all my profects and I need to access my email. Please help.

    hi guys,
    I had already deleted all reference to the hotmail account in question from the keychain access app, I have also tried to delete and re-instal the account details from within mail. The icon in the side bar dissapears but when I go to Add Account, the old account details are in the new account box. I then input my new password but am told that the server does not recognise it. If I access hotmail via google on the iMac I can get into my account with no problems. I am thinking there must be some other form of security system within the mac software that is blocking the new password. This is driving me nuts. I have been trying to resolve this for the last two days. Thank you for your advise anyway.

  • Problem with a time zone in Belarus, Minsk

    All Belarus users of Mac and iPhone/iPad have a problem with a time zone in Belarus, Minsk. If you set time in AUTO, then time going down for 1 hour from actual time. That is happened after Belarus didn't went for winter time this year. In this case on all Mac's and iPhones and iPad's didn't work at all Face Time, iMessage, iChat. Apple still not reacting for this problem.

    Same issue here... That is really annoying when such a good things like iCal sync just doesn't work.
    Also, in case if you trying fix it somehow... here is a lot of issues related to this one. e.g. if the time zone settings were set in manual order; we're get an authorization issue with applications like Twitter...

  • LaCie 6TB drive ejects when Air sleeps: I use two 6TB LaCie drives - home and office with my Air, which travels with me. Only have a problem with one. Is there a fix?

    LaCie 6TB drive ejects when Air sleeps: I use two 6TB LaCie drives - home and office with my Air, which travels with me between the locations. Only have a problem with one that inappropriately ejects when the Air sleeps (and only sometimes). Is there a fix? I've read others who believe that the problem is with the operating system (I'm using 10.9.2). But my problem suggests that it's with one of the LaCie's. Any suggestions about how to fix?

    Lacie doesnt make HD, thats a Seagate inside the box.
    Is there a fix?
    Yes, get a 4TB max HD,    6TB drives are both new and have known issues,  ...in fact so do most all 4TB drives.
    my problem suggests that it's with one of the LaCie's
    You mean Seagate
    Large external hard drives are great! Large external hard drives are horrible
    It is a common premise that people are overjoyed at the dropping prices per terabyte on external hard drives, and the first thing that enters most peoples minds is "great, I can put all my stuff on one drive,... all of it!" However considerations need to be made in creating a giant single choke point for not mere data loss, but seriously large data loss. If there is at the very least yet another redundant copy, this is fine, otherwise do not consider it whatsoever. Some 3TB and 4TB drives of all mfg. have, at the time of this writing, reliability concerns currently and best recommendation is staying at 2TB drives or less.
    Advantages and disadvantages of larger 3TB and 4TB external drives must be weighed

  • On success of form save I want to go to another for with a detail where clause

    I have the follow code snippet which is intented to go to a form on a successfull save. I query some data based on the save then build a url to navigate to a new form. I want the form to show only data that is lacking in one column not being populated (column is null). The url works, but the form detail where clause is ignored. Does anyone have any experience with passing detail where clauses to a form? Did I miss something in the code below?
    begin
    select count(rl_id) into n_rl_id_cnt
    from rfq_lines
    where part_part_id is null and rh_rh_id=n_rh_id;
    exception
    when others then
    null;
    end;
    htp.p('cnt '||to_char(n_rl_id_cnt));
    if n_rl_id_cnt>0 then
    htp.p('cnt >1');
    my_url := 'PORTAL30.wwa_app_module.link?' ||
    'p_arg_names=_moduleid&p_arg_values=3677858481' ||
    '&p_arg_names=_show_header&p_arg_values=YES' ||
    '&p_arg_names=rh_id&p_arg_values=' || LTRIM(TO_CHAR(n_rh_id)) ||
    '&p_arg_names=_rh_id_cond&p_arg_values=%3D'||
    '&p_arg_names=_detail_where_clause&p_arg_values=part_part_id%20is%20null'; -- <this is not working right. where clause is ignored.
    htp.p(my_url);
    go (my_url);

    Hi Jeffrey ,
    You need to use a custom Format script for the field.
    Regards
    Sukrit Dhingra

  • Create a view with a changing where clause

    Hi all,
    i'm developing an application with oracle forms i want to create a view in the database with a different where clause in every time , the where clause is determined due to the department id of the current user .
    thanks alot.

    SQL> create view emp_view as select empno, ename, deptno from emp;
    View created.
    SQL> select * from emp_view where deptno = 10;
         EMPNO ENAME          DEPTNO
          7782 CLARK              10
          7839 KING               10
          7934 MILLER             10
    SQL>

  • HT201250 Unexpected problem with Mac time machine!

    Hi every one!
    I'm having an unexpected problem with my time machine! the moment I hook up the back up drive my Mac crashes and the only thing I can do is to force restart. I'm not sure if the problem is with the back up disk or the Time Machine itself. I've successfully used the app since now and this just happens! I can neither access the disk in finder nor fix it by disk utility... would you please help me?
    PS. the disk is encrypted, I doubt that might be causing the problem?!    
    Thank you!
    chargar

    Launch the Console application by entering the first few letters of its name into a Spotlight search. Enter the name of the crashed process in the “Filter” text field. Post the messages from the time of the last crash, if any -- the text, please, not a screenshot.
    Then, still in the Console window, look under User Diagnostic Reports for crash logs related to the process. Select the most recent one and post the contents -- again, not a screenshot. For privacy’s sake, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)

  • Face time fades out and then tries to reconnect on new ipad retina display on WiFi.  Iphone 4s has no problem with face time from exact same location and same contact.  WiFi signal strong on both devices.  What gives?

    Face time fades out and then retries to connect (new Ipad Retina Display) on WiFi. Iphone 4s has no problem with face time from same location and same contact.  What gives?

    rdallas001 wrote:
    Is the router to small?
    Not necessarily, if you are using Facetime all the data goes through your WiFi router, your cable/DSL modem, your ISP and the internet to Apple's Facetime servers and then, in reverse, down to the Facetime recipient. If your ISP connection is too slow or there is excessive traffic on the internet you can have Facetime problems.
    Most WiFi routers can handle this unless others in the house are also using WiFi at the same time. The problem may be your ISP connection or congestion on the internet, etc.

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

Maybe you are looking for