Re-Query Crrent Record

Hi all
I have DB-Block, in the same window I have Button
When button pressed I Apply Update statment which update some field in the current record
then I have to make (execute_query) so the updates will appear.
Can I make RE_QUERY for the current record ONLY and not for all records?
thanx in advance

Hi,
You can do the execute_query.But it will fetch all the records.
For this you need to set the Value for the Primary key(or any key that will hetch a single record) and then execute_query
example
Before update statement
empno --123 ename--skh
after update
empno --123 ename--kth
Update record here
then write (:Block_name.filedname=<value>);
execute_query;
again on pre-query trigger
make it to null;
this will work.
Cheers,
Ravan.

Similar Messages

  • Creating new records while querying existing record

    Hi,
    I have one master - detail form.
    First i created 1 record. Request ID is the primary key. Now request id generated. For ex.: 10
    Request Id, date, requestor , location, status fields are in header block.
    In lines block, i hv some other fields.. and one field called 'Activity'.
    While creating first record, the activity will be 'New'.
    Then i'll query the record '10'.
    when i'm changing the activity 'New' into 'Upgrade', it should create new record with new request ID.
    How to do this?
    I hv written procedure that, i'm taking field values to local variables. Then assigning the local variable values to field values.
    It is not creating as new record. It overwriting the existing record with new values. Existing record is missing.
    Pl. give steps.
    Thanks
    Kavi

    Hi,
    Okk, you will have to do two things. Create two trigger on block level on which you want to do your changes.
    1. First trigger. (PRE-UPDATE)
    In pre-update trigger u will have to write the complete insert statement into the same table with new req id. like
    DECLARE
    vReqNo DATA_TYPE;
    BEGIN
    SELECT MAX(REQ_ID)
    INTO vReqNo
    FROM your_table;
    INSERT INTO your_table
    (req_no, fields....)
    VALUES
    (vReqNo, :forms_values);
    END;
    2. Create 2nd trigger on block level (ON-UPDATE)
    write in this trigger
    NULL;
    for viewing the inserted record. What u have to do is in ON-UPDATE after null; create one timer NO_REAPEAT.
    and in timer u will have to set the block property to req_id = generated_req_id_from_pre_update_trigger and
    execute_query;
    hope it will work...
    -Ammad

  • Disadvantage of 'QUERY ALL RECORDS' set to YES in DATA BLOCK

    Dear all,
    Can any one tell me disadvantage of 'QUERY ALL RECORDS' set to YES in DATA BLOCK. I have made a datablock 'QUERY ALL RECORDS' set to YES becoz of requirement 'restrict duplicate data entry'.For your information
    my datablock is multi record.
    Than You

    What if you have 1,000,000 records in your table and you query all records. Ouch!
    restrict duplicate data entryThat is standard database functionality: primary or unique key on the table.

  • Outer join two tables with query search record attached to both tables

    When I create a query with two tables that have query search records attached with outer join, PS seems to do a natural join (cartesian). We are on PT8.48.
    Is there a workaround for this issue. I do not want to remove query search record on either of the tables.
    I am trying to create an Emergency contact report. I am using two tables PS_EMPLOYEES and PS_EMERGENCY_CNTCT. Here is the sql PeopleSoft query generated when I did Left outer Join.
    Query SQL:
    SELECT A.EMPLID, A.NAME, A.ADDRESS1, A.CITY, B.PRIMARY_CONTACT, B.ADDRESS1, B.CITY, B.STATE, B.POSTAL, B.RELATIONSHIP, A.DEPTID, A.JOBCODE, A.COMPANY, A.EMPL_TYPE
    FROM (PS_EMPLOYEES A LEFT OUTER JOIN PS_EMERGENCY_CNTCT B ON A.EMPLID = B.EMPLID ), PS_EMPLMT_SRCH_QRY A1, PS_PERS_SRCH_QRY B1
    WHERE A.EMPLID = A1.EMPLID
    AND A.EMPL_RCD = A1.EMPL_RCD
    AND A1.OPRID = 'SREESR'
    AND (B.EMPLID = B1.EMPLID OR B.EMPLID IS NULL )
    AND B1.OPRID = 'PS'
    Appreciate any help.

    I think there are fixes for this issue in later tools releases (Report ID 1544345000). I'm not sure about 8.48, but you might try the workaround documented in
    E-QR: Left Outer Joins with Security Records are returning unexpected results [ID 651252.1]
    on Oracle Support.
    Regards,
    Bob

  • How do I take data from a query sample record and query another block with it?

    I have a master/detail form (6i) that contains a master block (staff), and a detail block (phone). I would like to be able
    to query by phone number, but when I execute the query, I would like a 'search results' box to pop up that contains the
    phone number I queried for, as well as some other staff info. There might be multiple records that match my query,
    and I'd like them all to be listed (or list 10 or so, with a scrollbar). I'd like a push button next to each record that will take
    me back to the master/detail window with that record displayed. So, I created a third block that is based on a joined
    view of the staff and phone tables. It is a multi-record block, with 10 recs displayed and a scrollbar. It is in a separate
    window. I don't want the user to have to navigate to that block, however, to perform their query. I would like them to be
    able to enter the query in the phone number block, then somehow grab the phone number they've entered and use it to
    query my 'search' block. This is the part I'm having trouble with. Can someone please help? THANKS!

    Where do I put that line of code? I see that it goes at the Script part near the top, but how can I use that, I am pretty new to this language. I am not familiar with this line, where does it bind the value from the datagrid to the variable?
    fullXML[myDataGrid.selectedIndex].FIELD_NAME;
    myDataGrid would be the id from the grid I am guessing?
    and selected index would be the channel.description part?
    and FIELD_NAME; is the variable name?
    does this go into a funtion or is it placed at the top where the variables are declared?

  • SAP Query: Duplicte records after joining table CSKT

    Guru's,
    We have created a query in SQ02 for Z table which has fields with KOKRS and KOSTL as well.
    Ztable fields:
    PLAN_TYPE
    PLAN_PROCESS
    KOKRS
    KOSTL
    We want to display cost center description. SO joining this Z table with CSKT(KOKRS,KOSTL). We are getting duplicate records in output because CSKT has duplicate KOSTL.To solve this, we want fetch Latest KOSTL comparing DATBI  GE SY-DATUM.
    Can anybody help us how to code this logic in Query. I have gone thru most of the SDN threads but could not find the answer.
    Please help us.
    Thanks in Advace.
    Shreyansh

    Moderator message - Duplicate post locked

  • Problem in querying the records

    what is the thing changing the values on my master/detail form n giving me a message that "do u want to save the record" on fetching of each record? even if there is not pre or post-query trigger. is there any problem in the default Master-Detail trigger created while creating a relation? plzzz tell me this

    Sometimes it happens when some plsql program modifies the value of a database field in one of the database blocks. So try checking all your plsql. As there is no other reason for it. Becoz master-detail relation never does it.

  • Infoset Query - Filter Records

    Dear Experts,
    Please help me in defining in-built filter (by field values) in an Infoset query.
    Regards
    Jogeswara Rao

    Thanks Venu,
    This I am following already.
    But this is not totally fool-proof. If someone uses his own selection screen variant then the setup disturbs.
    If you are referring to ALV layout variant, that does not solve my problem. Because the output just filters the records, but the records are selected, this selection gives rise to a problem here (in some calculations)
    In-fact the filter word in my query, is meant towards Not selecting OR Deleting records of certain field values
    So I want this to be in-built either in Infoset itself or query design.
    (of course, I prefer a way free of code)
    Regards
    Jogeswara Rao
    Any inputs Expers?
    Kind Regards
    Jogeswara Rao
    Edited by: K Jogeswara Rao on May 22, 2011 9:22 AM

  • Query for records on a block with Query Data Source Type : Procedure

    Hi All,
    The veriosn of form I'm using is:
    Forms [32 Bit] Version 6.0.8.23.2
    I have a block based on a procedure.
    But when I enetr-query and search for records specific to ceratin criteria even then the result of the Query is all records.
    Is Query not allowed on a block with Query Data Source Type : Procedure.
    Hope my question is clear.
    Thanks in advance.
    Regards
    Arif

    When you use a table based block, forms can construct any select with any where clause based on the given inputs. Using a procedure based block, forms cannot "know" which in or out parameter of the procedure corresponds to which item. Even if Forms could pass the value of an item to an argument automagically, the procedure would have to "do something" with the argument, and you´d have to code it.
    So, any item that should be used in the where-clause must be mapped to an argument.
    Perhaps it would be easier to use a table based block querying a view? For DDL, you could use an instead-of-trigger on the view.
    Regards,
    Gerd

  • Querying Multi-Record XML

    Hi,
    I have inserted the following XML document in to a table with an XMLType column:
    <?xml version="1.0" encoding="UTF-8"?>
    <PhotoImaging xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/xdb/photoImaging.xsd">
         <EmpData>
              <VRN>1111</VRN>
              <Surname>Shah</Surname>
              <Forename>Sunil</Forename>
              <PayNo>1234</PayNo>
              <WarrantNo>1234</WarrantNo>
              <ImageFile>c:\sunil.jpg</ImageFile>
              <ImageDate>12-12-04</ImageDate>
         </EmpData>
         <EmpData>
              <VRN>2222</VRN>
              <Surname>Malde</Surname>
              <Forename>Kalpa</Forename>
              <PayNo>5678</PayNo>
              <WarrantNo>5678</WarrantNo>
              <ImageFile>c:\kalpa.jpg</ImageFile>
              <ImageDate>12-12-05</ImageDate>
         </EmpData>
    </PhotoImaging>
    This is just a simple XML document with 2 records.
    The problem I am having is when trying to query this document to retrieve, say, all the Surname's.
    I can use:
    select extractvalue(xml, 'PhotoImaging/EmpData/Surname') from mphr2_photo_xml
    This works well if the XML document only contains one record, but in my case the XML document will contain hundreds of records and 'extractValue' can only return one value.
    Does anyone know of a way to query this XML document and return all the Surname's??
    Thanks, Sunil

    It's OK. I got it from looking at some of the other threads.
    For information the SQL is as follows:
    select extractValue(value(q), '//Surname')
    from mphr2_photo_xml,
    table (xmlsequence(extract(xml, '/PhotoImaging/EmpData'))) q

  • SQL Query - Multiple records from value of field

    I have a table that has the following lay out
    ID
    AreaUnitServes
    Filter1Quantity
    Filter1Size
    Filter2Quantity
    Filter2Size
    And I’m trying to convert it to
    FkPSAUnitsID
    Size
    Location
    I’ve got the following query started but I’m stuck on how to INSERT INTO multiple records by the value of Filter1Quantity. I also have to query for Filter2Quantity.
    INSERT
    INTO RapidServ.dbo.PSAFilters
    (FkPSAUnitsID,Size,Location)
    SELECT ID
    AS FkPSAUnitsID,Filter1Size
    AS Size,
    AreaUnitServes
    AS Location
    FROM RapidServ.dbo.PSA
    Thanks,
    why767

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you probably need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> I have a table that has the following lay out <<
    How nice for you! Why did you draw ASCII pictures?  It has all kinds of magical names. The table is nameless because it is forbidden by a wizard to speak its name? There are generic, universal “size” and “location”of nothing in particular. Is the “fk-”
    prefix a meta data design error for “foreign key”? We never do that in RDBMS; name a data element for what it is by its nature, not for how it was used in one place in one schema. This is why we have no magical “id” in a valid schema. Data elements do not
    change names from table to table. 
    You seem to have inherited a pile of garbage with a repeated group in it. Look up First Normal Form (1NF). You also do not know why row is not a record and why fields are  not columns. Did you notice that “area_unit_serves” is a sentence and not
    a name? 
    >> I’ve got the following query started but I’m stuck on how to INSERT INTO multiple records [sic] by the value of Filter1Quantity. I also have to query for Filter2Quantity. <<
    My guess until I get a usable business rules and DDL is that you can use a UNION something like this skeleton: 
    INSERT INTO PSA_Filters (psa_units_id, filter_size, area_service_unit)
    SELECT psa_units_id, filter_1_size, area_service_unit
      FROM Magic_Nameless_Stuff
    UNION ALL
    SELECT psa_units_id, filter_2_size, area_service_unit
      FROM Magic_Nameless_Stuff;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Problem with Select query fetching records.

    Hi All,
    SELECT bukrs belnr gjahr bldat cpudt aedat cputm usnam xblnr bktxt waers
                       FROM bkpf INTO TABLE bkpf_tbl
                       WHERE bukrs IN s_bukrs AND blart IN ('RE' , 'ZL')
    AND ( ( cpudt > prv_date )
                       OR    ( cpudt = prv_date AND cputm >= prv_time ) )
                       OR  ( ( aedat > prv_date )
                       OR    ( aedat = prv_date AND cputm >= prv_time ) )
                       AND gjahr IN s_gjahr
                       AND monat IN s_monat
                       AND belnr IN s_belnr
    My prv_date is 05/04/2010 while debugging.
    CPUDT (Accounting Document Entry Date) in BKPF doesnu2019t have any entries.
    But AEDAT (Date of the Last Document Change by Transaction) is having a single entry on date 05/04/2010.
    While this query is showing number of records around 200000. I feel something is wrong with the AND/OR statements.
    Please suggest some ideas?

    Hi Mishra,
    I dont know the excaly wht u r passing in the prv_date and cpudt . But one thing i notice that blart part.
    SELECT bukrs belnr gjahr bldat cpudt aedat cputm usnam xblnr bktxt waers
                       FROM bkpf INTO TABLE bkpf_tbl
                       WHERE bukrs IN s_bukrs AND blart eq  'RE' or  blart eq 'ZL'
      AND ( ( cpudt > prv_date )
                       OR    ( cpudt = prv_date AND cputm >= prv_time ) )
                       OR  ( ( aedat > prv_date )
                       OR    ( aedat = prv_date AND cputm >= prv_time ) )
                       AND gjahr IN s_gjahr
                       AND monat IN s_monat
                       AND belnr IN s_belnr.
    With Regards,
    Sumodh.P

  • Query returns record in SQL Developer but not in iSQLPlus

    ... back in a minute, I may not have done a commit at the end of the insert.
    The problem I was having was I hadnt commited the record in SQL Developer but the queries where returning records in this environment but not in iSQLPlus or Apex and it was confusing me.
    Message was edited by:
    Benton
    Message was edited by:
    Benton

    Finally got to know the reason why Timezone Abbr woudn't show up in SQL Plus.
    I ran below query in SQL PLUS
    SELECT SESSIONTIMEZONE, CURRENT_TIMESTAMP, systimestamp, LOCALTIMESTAMP FROM DUAL;
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    -05:00 08-SEP-12 12.00.31.575228 AM -05:00 08-SEP-12 12.00.31.575223 AM -05:00 08-SEP-12 12.00.31.575228 AM
    Now executed the same query in SQL Developer:
    SESSIONTIMEZONE CURRENT_TIMESTAMP SYSTIMESTAMP LOCALTIMESTAMP
    America/Chicago     08-SEP-12 12.08.32.072424000 AM AMERICA/CHICAGO     08-SEP-12 12.08.32.072420000 AM -05:00     08-SEP-12 12.08.32.072424000 AM
    The difference between the 2 outputs is the way in which time_zones were respresented. In SQL PLUS, it is shown as an offset whereas in SQL Developer as a time zone region name. Now there are many "time sone regions" that follow an offset of -5:00. This confuses Oracle and a "UNK"(Unknown) for a query like the one below when trying to execute in SQL PLUS:
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    UNK
    Therefore we need to specify the exact Time Zone Region(TZR) in order to obtain the corresponding TZD(Daylight Savings Format i.e. CDT or CST). This we do by altering the session environment vaiable time_zone
    alter session set time_zone='America/Chicago';
    Now executing the queries to find the abbreviated time zone( in TZD format) will finally work to return a non-null char value.
    select extract(timezone_abbr from from_tz(cast(sysdate as timestamp),SESSIONTIMEZONE)) from dual;
    EXTRACT(TI
    CDT
    select to_char(CURRENT_TIMESTAMP, 'TZD') from dual;
    TO_CHA
    CDT

  • SQL releated question: Increase field value upon query of record

    Hi
    upon a database query i would like the database to automtically access an integer field (kind of hit counter) in each record that was selected (is part of the result set).
    For speed reasons i thought it would be great if that could be done on the database server side, so i don't have to create additional queries just do select und update a record.
    I just read a bit about triggers, but not i don't see if i could use a trigger that for and have no idea how to create a trigger for that purpose (haven't found a good tutorial 'till now..).
    Could this be done with triggers? How would I have to do this?
    Thanks for your help
    josh

    Hi Avi
    thanks for the explanation.
    I see, triggers are not useful to do what i want. As you explain i could create a stored procedure. There procedures are just 'simple' SQl queries, right?
    I guess i could do it the way you described. If i understand it right, it's very similar to creating a second query which UPDATEs the specified field (that's what i do at the moment).
    One additional question if you don't mind. Is there any way to declare a kind of "evaluation code" that can be placed into a database field that would do some simple task i.e. i have two tables, in the first i have all categories and in the second i have all elements. I have the categorie id stored with the elements as primary key. Now i would like to have a database field in each categorie record that contains the actual number of all related elements. I could manualy update this field each time a realted element gets added or deleted, but it would be easier if there was some "code" i could set into that field that lets the database automatically evaluate the right value. Is that possible?
    Thanks again
    josh

  • Form won't query existing record

    I'm creating a User Preferences page based on a table that contains one record per user, with the primary key = user_id.
    The form creates the record fine. If I exit the form and get back in, however, it does not fetch that existing record.
    The form has:
    - An Application Item called GLOBAL_ID
    - An Application Computation called GLOBAL ID with:
    Computation Point=*On New Instance*
    Computation Type=SQL Query
    Computation=select f_get_id from dual
    - A page Process called Fetch row from SZBRPRF with:
    Process Point=*On Load Before Header*
    Run Process=Once per Page Visit, ...
    Item Containing Primary Key Column Value=*P1_USER_ID*
    Primary Key Column=*USER_ID*
    DML Fetch Mode=Set Memory Cache on Fetch
    Runtime Where=*USER_ID = :GLOBAL_ID*
    Success Message=*Fetched record for &GLOBAL_ID.*
    - The P1_USER_ID item has the following attributes set:
    Source Type=*Database Column*
    Source Value or Expression=*USER_ID*
    Default Value=*:GLOBAL_ID*
    Default Value Type=*PL/SQL Expression*
    When I open the page, the success message (Fetched record for +389+ is displayed, but the values are not.
    So it looks like GLOBAL_ID does contain the value I want it to contain, at the time the fetch is executed, but the record is not found?
    If I enter a value in one of the fields and click on Create, I get a unique constraint error.
    I have also confirmed, via SQL*Plus, that the record exists in the database.
    I keep thinking the problem is with the P1_USER_ID field, and have tried various combinations, but it still isn't working.
    Any suggestions would be greatly appreciated.

    Laura - Please change your handle to something easier to read and put your first name in your profile to assist us. Thanks.
    Computation=select f_get_id from dualIf f_get_id uses APP_USER to determine the record ID, you should move that item-setting code into the authentication scheme's post-authentication process instead of using an on-new instance computation.
    - A page Process called Fetch row from SZBRPRF with:
    Process Point=*On Load Before Header*After-Header is a good firing point for ARF processes
    Runtime Where=*USER_ID = :GLOBAL_ID*This seems redundant. I'd remove it.
    - The P1_USER_ID item has the following attributes set:
    Source Type=*Database Column*
    Source Value or Expression=*USER_ID*
    Default Value=*:GLOBAL_ID*
    Default Value Type=*PL/SQL Expression*The ARF process fires way before any form item attributes (like Default Value) are evaluated. Plus, if the PK item is null, the ARF process doesn't fetch anything (the process success message notwithstanding).
    I keep thinking the problem is with the P1_USER_ID field, and have tried various combinations, but it still isn't working.I think a before-header computation to set P1_USER_ID is your best bet (as Dimitri suggested). Make sure it fires before the ARF process.
    Scott

Maybe you are looking for

  • Plans to abandon Silverlight?

    Are there plans to replace the Silverlight-based Web interface of RT-targets?  Just ran into issues with it and Google Chrome, and the consensus seems to be that Silverlight as a technology is dead...but surprisingly I could not find much discussion

  • Top Level folder doesn't show lowver level pictures - Lightroom2

    I have my pictures stored by year and location on a hard drive    example 2009     Heaven        April     Hell          April As I remember each upper level would show the counte of sub folders which allowed me to do sorts on ratings and the like No

  • 10.5.8 server open directoy replica to master

    Hello, I'm using a XServe runnig 10.5.8 Server as open directory master and another Xserve also runnig 10.5.8 Server as open directoy replica. Now I want to turn off the master and the replica as new Master. If I want to switch from replica to master

  • In iOS6 hitting "reply to all" in mail, my own adress gets included in the recipients -

    I updated my iPhone 4 to iOS6 yesterday and now whenever I hit "reply all" to an email it includes my email in the CC field.  Annoying, of course, because I get a new email, and it also adds me to the list of people in the thread.  Has anyone else se

  • Mac mini external speaker problems

    my mac mini using an audio interface (Lexicon: Lambda) and linking with external speaker (ADAM: A5x). they can play music and video smoothly before Mavericks update recently.  After the updated, I can't play music and videos with iTunes and youtube s