Check select query

Hi friends,
I need to check if the below update statement ran successfully in the database..
update tranp
set serialno = (select transt.serialno from transt, tranht where tranp.billno= tranht.billno and tranht.refno = transt.refno);
Is it possible to check? Please help...
Thank you

Hi Pavan,
I'm getting this error..
select a.*,b.transt,b.serialno
from tranp a, (select transt.serialno from transt, tranht where tranp.billno= tranht.billno and tranht.refno = transt.refno) b
where a.serialno(+) = b.serialno;
tranp.billno invalid identifier
When I add tranp to the sub select I get this error..
select a.*,b.transt,b.serialno
from tranp a, (select transt.serialno from TRANP,transt, tranht where tranp.billno= tranht.billno and tranht.refno = transt.refno) b
where a.serialno(+) = b.serialno;
B.transt invalid identifier
Please help.. thanks

Similar Messages

  • Error in Extended syntax check- Select Query

    Hi all,
    Iam getting this following error in Extended syntax check
    " Large table PA0002: No field of a table index in WHERE
    condition"
    Code :SELECT SINGLE PERNR INTO (G_PERNR) FROM PA0002 WHERE ZZLEGACY_PAYROLL = I_FILETAB-PRNO
                                                           AND ZZLEGACY_PAYSYS = I_FILETAB-PRSYS
                                                           AND ZZLEGACY_PAYINS = I_FILETAB-PRINS.
    can anyone help on this?

    Hi,
    Change the code like this and check............
    For this u need put INSIDE LOOP.
    Select single PERNR into G_PERNR from PA0002 where PERNR = I_FILETAB-PRNO and .......... and ......
    Check like this...
    Thanks.
    If this helps you reward with points.
    Message was edited by: KDeepak
    Message was edited by: KDeepak

  • Check Index used in an oracle select query

    Hi Friends,
    I have partitioned an oracle table and created Local Index for the Partitioned table .
    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?
    Please let me know.
    Regards,
    DB

    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.Why? Have you proven that using this local index is the "best" plan?
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?When I asked Google "how to read an oracle explain plan," I found lots of information - what did you find?

  • Select query gives error in Code inspector and extended program check

    Hi,
    I have a query .
    SELECT pernr
      FROM pa9100
      INTO TABLE t_nca_tab
      WHERE endda EQ c_date AND
      z_nca_required EQ c_yes.
    This query gives me an error in Code inspector like :
    Large table pa0001: No first field of table index in WHERE  condition
    I have one more query that gives error in extended program check
    SELECT SINGLE stell ename
          INTO (g_stell, g_name)
          FROM pa0001
          WHERE pernr EQ wa_nca_tab-pernr AND
                endda EQ c_date.
    The warning says:
    *In "SELECT SINGLE ...", the WHERE condition for the key field "SEQNR" does not
    test for equality. Therefore, the single record in question may not be unique.*
    Its too urgent.
    Please reply.
    Regards,
    Binay.

    The first field is PERNR .. so if UR not giving pernr it will fetch
    all the data from the said table and between the given dates ..
    Check if this is your requirement ...
    write the select as ...
    where r_pernr is a range ...
    SELECT pernr
    FROM pa9100
    INTO TABLE t_nca_tab
    WHERE pernr in r_pernr  <----
                 endda EQ c_date AND
                 z_nca_required EQ c_yes.
    As UR using select single it's expecting to use all the key
    fields in the where condition ...
    U can ignore this warning message

  • Alternative for "check select-options" for select query.

    hi all,
    my report is using a "GET" syntax, followed by "check select-options".
    My senior told me to replace the Get syntax with select query.
    Now, my program also has dynamic selection screen.
    the dynamic selection screen almost has all the fields of database table.
    so, what is the way to replace this check select-options while applying select query?
    can you tell me how dynamic selection screen fields are populated? are they stored in some internal table?
    thanks for help.

    HI
    Here is some points about LDB.
    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.
    However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area
    For further on LDB's refer to this link.
    [http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm]
    Hope this will help.
    Reward if helpful.
    Sumit Agarwal

  • Problem in the "select" query....Just check out and help me

    Hi there !!
    I am getting the following errors while trying to execute the "select" query from JSP page:
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    My code is :
    String reg_no=(String)session.getAttribute("reg_no");
    ResultSet rs=stmt.executeQuery("SELECT * FROM reg WHERE regno = "+reg_no);
    (Note: the "regno" in the database is of numeric datatype)
    Try to help me...
    Thanx,
    Ram.

    Just so everyone knows:
    Ram Mohan joined the forum on 7-Sep-2003 and received
    his 25 Dukes for joining.
    Since then, he's posted three questions, each one
    promising 5-10 Dukes, and never once awarded them.
    His strategy seems to be to wave Dukes, ask his
    hit-and-run question, and then bolt.
    Answer his questions if you wish, but don't do it
    expecting Dukes. - MODDuffy, you're getting just as cranky as I have. See what hanging around these forums does to oneself? :)

  • Select query in MB51 failing only for posting date(BUDAT)02/02/2010

    Hello Experts,
    I am having below select query.
    It is running perfectly fine for all the dates except 02/02/2010.On all other dates it is getting executed with in second.
    For 02/02/2010 it keeps on running for more than 10 minutes and then fails with timeout error.
    Please let me know if anyone know any solution for this.
    select (g_t_fields)
        into corresponding fields of table itab
        from mkpf inner join mseg
        on    mkpfmandt = msegmandt
          and mkpfmblnr = msegmblnr
          and mkpfmjahr = msegmjahr
           WHERE MKPF~BUDAT in BUDAT
             and MSEG~BWART in BWART
             and MSEG~CHARG in CHARG
             and MKPF~FRBNR in FRBNR
             and MSEG~KUNNR in KUNNR
             and MSEG~LGORT in LGORT
             and MSEG~LIFNR in LIFNR
             and MSEG~MATNR in MATNR
             and MSEG~SOBKZ in SOBKZ
             and MKPF~USNAM in USNAM
             and MKPF~VGART in VGART
             and MSEG~WERKS in WERKS
             and MKPF~XBLNR in XBLNR
    %_HINTS
    ORACLE '&SUBSTITUTE VALUES&'
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting and please use code tags when posting code - post locked
    Edited by: Rob Burbank on Feb 4, 2010 9:02 AM

    Hi Sameer,
    Please check on which date the production order has status as "completed".
    It could be on 01.02.2015.
    Thanks,
    Vimal

  • Supress the ROW_ID column in the Select Query.

    Hi,
    I have one custom form and from main form I am calling the Line Form.
    But when I am clicking the LINE button then Form is getting open but it is giving one Error message like
    FRM-40505: Oracle Error:unable to perform query
    Once I check the Detail error.
    it is giving me this message.
    ORA-00904: "ROW_ID": invalid identifier
    And I checked the query my query is returning the ROW_ID column.
    Please help on Suppressing the Row_id column getting selected from the query.
    Thanks
    Nihar

    Hi Nihar;
    Please see:
    Transactions Workbench Error: Listing of FRM Errors [ID 1321612.1]
    Regard
    Helios

  • Problem with JOINs in SELECT query

    The parameter  wa_dob-e_dob is not getting its definition ....
    it contains DOB in current yr.
    As i am using Joins also Workarea.... so is it coz Joins & WA cant be used simultaneously in a SELECT query....
    Is there any other option to do the same...?
    *  Global Structure
    TYPES : BEGIN OF t_data ,                     "Structure
            emp_dob TYPE pa0002-gbdat,
            emp_Mailid TYPE pa0105-usrid,
           END OF t_data,
           BEGIN OF t_dob,
           e_dob TYPE pa0002-gbdat,
           e_pernr type pa0002-pernr,
           END OF t_dob.
    *  Global Internal Tables (I_)
    DATA : i_data TYPE TABLE OF t_data,           "Internal Table for output data
           i_dob TYPE TABLE OF t_dob.             "Internal table for Dob
    *  Global Work Area (WA_)
    DATA : wa_data TYPE  t_data,                  "Work Area for output data
           wa_dob TYPE  t_dob.                    "Work Area for Dob
    *this is the query where i am getting error
    * Field "WA_DOB-E_DOB" Not found.
    LOOP AT i_dob INTO wa_dob.
        SELECT pa0002~gbdat pa0105~usrid INTO CORRESPONDING FIELDS OF wa_data
          FROM pa0002
          INNER JOIN pa0105
          ON pa0002~pernr = pa0105~pernr
          WHERE  pa0105~subty EQ 'MAIL' AND
         wa_dob-e_dob BETWEEN w_sysdate AND w_edit_sysdate.
        ENDSELECT.
        APPEND wa_data TO i_data.
        CLEAR wa_data.
        CLEAR wa_dob.
        CLEAR l_temp_dob.
      ENDLOOP.

    Hi,
    you are checking the work area in the SELECT. IN WHERE condition of the select u should specify fields in either of the tables pa0002 , pa0105 for data population.
    The select is on the database table and not on the work area.for checking the data in the work area do this way:
    loop at it_dob into wa_dob.
    if wa_dob-e_dob between the range u want (w_sysdate AND w_edit_sysdate)
    endif.
    endloop.
    ie: wa_dob-e_dob >w_sysdate AND wa_dob-e_dob < w_edit_sysdate or
        wa_dob-e_dob < w_sysdate AND wa_dob-e_dob  >  w_edit_sysdate
    watever ur requirement is..
    regards,
    madhu

  • Need help in writing a select query to pull required data from 3 tables.

    Hi,
    I have three tables EmpIDs,EmpRoles and LatestRoles. I need to write a select Query to get roles of all employees present in EmpIDs table by referring EmpRoles and LatestRoles.
    The condition is first look into table EmpRoles and if it has more than one entry for a particular Employee ID than only need to get the Role from LatestRoles other wise consider
    the role from EmpRoles .
    Sample Script:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1),(2),(3)
    Insert into #EmpRoles values (1,'Role1'),(2,'Role1'),(2,'Role2'),(3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    Employee ID 2 is having two roles defined in EmpRoles so for EmpID 2 need to fetch Role from LatestRoles table and for
    remaining ID's need to fetch from EmpRoles .
    My Final Output of select query should be like below.
    EmpID Role
    1 Role1
    2 Role2
    3 Role1
    Please help.
    Mohan

    Mohan,
    Can you check if this answers your requirement:
    Create Table #EmpIDs
    (EmplID int )
    Create Table #EmpRoles
    (EMPID int,Designation varchar(50))
    Create Table #LatestRoles
    EmpID int,
    Designation varchar(50)
    Insert into #EmpIDs values (1)
    Insert into #EmpIDs values (2)
    Insert into #EmpIDs values (3)
    Insert into #EmpRoles values (1,'Role1')
    Insert into #EmpRoles values (2,'Role2')
    Insert into #EmpRoles values (2,'Role1')
    Insert into #EmpRoles values (3,'Role1')
    Insert into #LatestRoles values (2,'Role2')
    --Method 1
    select e.EmplID,MIN(ISNULL(l.Designation,r.Designation)) as Designation
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    left join #latestRoles l on e.emplID=l.EmpID
    group by e.EmplID
    --Method 2
    ;with cte
    as
    select distinct e.EmplID,r.Designation,count(*) over(partition by e.emplID) cnt
    from #empids e
    left join #emproles r on e.emplID=r.EmpID
    select emplID,Designation
    from cte
    where cnt=1
    UNION ALL
    select a.EmplID,l.Designation
    from
    (select distinct EmplID from cte where cnt>1) a
    join #Latestroles l on a.EmplID=l.EmpID
    order by emplID
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Can I retrieve data from a multiple select query?

    I recently have been able to consolidate many queries into one large one, or into large compound queries. I found an instance where I am using a select query in a for loop that may execute up to 400 times. I tried building a huge compound query, and using DB Tools Execute Query vi, followed by the DB Tools Fetch Recordset Data vi. The query executes at the database without an error, but the Fetch Recordset Data vi only returns the first instance. Is there a way to retrieve all the data without having to send up to 400 separate select queries?

    Sorry I didn't replt earlier, I was on vacation. The query I am using is to check serial numbers, and determine if they are all valid. The programs purpose is to define a serial number to a pre-existing part number. Our company makes inclinometers and accelerometers, and this entire series of LabVIEW programs is designed to automate the calibration and testing of these units. The part number definitions can contain 3 or 4 hundred parameters, so the database itself consistes of 44 tables with potentially several hundred columns per table. It is designed to not only provide definitions to every part number, but also to store all potential raw unit data to be calculated and formed into a report at any time. The logistics of getting that much data in and out of the database have forced me to do things more effeciently. The actual query in question is to take each serial number either manually entered, or automatically picked, and see if they already exist with the part number they are being defined as. If there are any duplicates, then the program will alert the operator that serial numbers x, y, and z for instance have already been asigned as the part number in question. Currently I run a simple query once for each serial number. This works, but there may be 200 serial numbers assigned. Also the serial numbers can contain upper or lower case letters. By making all the serial number letters into capitals, then into lower case, it could mean up to 400 individual queries going out over the LAN. This is a bandwidth hog, and time consuming. I started experimenting with compound queries. The actual query used is below.
    SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000005';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000006';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000007';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000008';SELECT SERIALNO FROM "maintable" WHERE PARTNO = '475196-001' AND SERIALNO = '3000009'
    When I execute this query, SQL Server 2000 has no problem with it, but the DB Tools Fetch Recordset Data vi only returns the first match. I think my answer may lie with OR statements. Rather than sending what amounts to potentially dozens of individual queries, I should be able to chain them into one query with a lot of OR statements. As long as the OR statement is not an exclusive OR statement, I think it should work. I haven't tried it yet, and it may take some time to get the syntax right. The query is built in a for loop with the number of iterations equal to the number of serial numbers being defined. Once I get this working I will alter it to include both upper and lower case letters that can be included in the query. Any suggestiona of how the query should be structured would be most helpful, or another way to achieve what I am trying to accomplish.
    SciManStev

  • Select query problem in JDBC sender adapter

    Hello Experts,
    We have a problem with PI sender adapter that PI has started to miss records in database some database records are missing and we are using the below selet query :
    SELECT * FROM [database name].[dbo].[Material_Movement] WHERE [Process_Order_Number] = (Select TOP 1 [Process_Order_Number] FROM [database name].[dbo].[Material_Movement] WHERE ([PI_Read_Date] IS NULL AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC))) AND [Transaction_Code] = 'xyz' AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC) AND [PI_Read_Date] IS NULL ORDER BY [Transaction_ID] ASC
    I am weak in select query could you please check and suggest how the query can be modified to avoid this issue .
    Thanks,
    Somenath

    Hi ,
    After looking into These Query .. I found ...
    Your Query Will run such Kind of scenario ..
    1.)   Movement Type will be fetched from from below Query
            SELECT TOP 1 Movement_Type
            FROM database name.dbo.Material_Movement
            WHERE Transaction_Code = 'xyz'
           AND PI_Read_Date IS NULL
            ORDER BY Created_Date ASC
    2.) on the  basis of abovr fetched  moment code . your Query will fetch 1 Process Order number
    Select TOP 1 Process_Order_Number
    FROM database name.dbo.Material_Movement
    WHERE ( PI_Read_Date IS NULL
                  AND Movement_Type =  Moment Type will be same as 1.
    3.)
    After  Getting 1 and 2 . Query will fetch Data  from table " dbo.Material_Movement "
    On the basis of ..
    Movement_Type = value from 1.
    Process_order_type = value from 2.
    Transaction_Code = 'xyz'
    ORDER BY Transaction_ID ASC
    So check Missed record Fullfill this Condition or not ....................
    If not ... You will get why they are not picked by your given Query ...........
    Hope it helps ..
    regards
    Prabhat Sharma.

  • I am getting dump error while running one report in one select query

    Hi,
    While running a report program, I am getting a dump error in one select query. So could you please correct the select query so that I can't face the dump error.
    SELECT vbeln parvw kunnr INTO CORRESPONDING FIELDS OF TABLE l_t_vbpa
      FROM vbpa
      FOR ALL ENTRIES IN l_t_backorder_item
      WHERE vbeln = l_t_backorder_item-vbeln AND
      ( ( parvw = c_we AND kunnr IN rng_shipto ) OR  ( parvw = c_ag AND
      kunnr IN rng_soldto ) ) .
    <removed by moderator>
    Best Regards,
    BDP
    Edited by: Thomas Zloch on Apr 30, 2010 12:31 PM

    Hi Bansidhar,
    It would be helpful if you could tell what type of dump it is.
    If it is a timeout you should check whether l_t_backorder_item is empty - in this case ALL document numbers are selected. f you get the timeout with a populated table consider converting the l_t_backorder_item table into one ore more ranges tables - the select with ranges tables is way quicker than 'for all entries'. But take care the ranges table has not to many entries - the SAP SQL converter puts this into one huge SQL statement and this might become too big to be handled by the database (depends on the actual underlying database).
    I would also consider splitting the SELECT into two (2nd one with 'appending into table') to make the code easier to understand It also helps the database system determining a strategy for the select.
    Regards,
    Gerd Rother

  • Error coming while running  Hibernate HQL  select query in jdeveloper

    Hi ,
    I have created hibernate application with just create query its running fine, i also writeen HQL select query below exception is coming,
    CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
    i also checked org.hibernate.hql.ast.HqlToken , its thr in jar file, eventhough it is throwing error.
    plz give sollution

    Hi dvohra,
    I have written below code
    List l1=new ArrayList();
    try{
    HibClass hib = new HibClass();
    Session session = hib.currentSession();
    Transaction tx = session.beginTransaction();
    Manager m;
    System.out.println("server------------------------");
    //Using from Clause
    String SQL_QUERY ="from Manager manager";
    Query query = session.createQuery(SQL_QUERY);
    List list = query.list();
    for (int i = 0; i < list.size();
    i++) {
    Manager manager =
    (Manager) list.get(i);
    System.out.println(
    "MId " +
    manager.getMid() +
    " Manager Name: " +
    manager.getMname());
    m=new Manager();
    m.setMid(manager.getMid());
    m.setMname(manager.getMname());
    l1.add(m);
    session.close();
    }catch(Exception e){
    System.out.println("helo-------------error---------"+e.getMessage());
    }finally{
    return l1;
    still below exception is coming
    CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
    oc4j is shutting down
    i am trying from 4 days , help me

  • Error While Firing select Query  on Table

    Hi aill,
    we have Oracle 11g RG2 RAC on Production Machine. When I am firing select query on one partiton table,it will show me below error in Alter Log file :
    Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0] [PC:0x84056AA, kkpamDInfo()+38] [flags: 0x0, count: 1]
    Errors in file /opt/app/oracle/diag/rdbms/winsdb/WINSDB2/trace/WINSDB2_ora_29686.trc (incident=288563):
    ORA-07445: exception encountered: core dump [kkpamDInfo()+38] [SIGSEGV] [ADDR:0x0] [PC:0x84056AA] [Address not mapped to object] []
    Incident details in: /opt/app/oracle/diag/rdbms/winsdb/WINSDB2/incident/incdir_288563/WINSDB2_ora_29686_i288563.trc
    While checking the trace file :
    ========== FRAME [2] (ksedst1()+98 -> skdstdst()) ==========
    defined by frame pointers 0x2ba371efaa40 and 0x2ba371efa990
    CALL TYPE: call ERROR SIGNALED: no COMPONENT: KSE
    RDI 0000000000000000 RSI 0000000000000000 RDX 00002BA371EF6118
    RCX 0000000000000001 R8 0000000000000000 R9 0000000000000000
    RAX 0000000000000000 RBX 0000000000000003 RBP 00002BA371EFAA40
    R10 71EFA9A000000000 R11 0000000000000000 R12 0000000000000003
    R13 0000000000000003 R14 0000000000000001 R15 0000000000000001
    RSP 00002BA371EFA9A0 RIP 000000000349E72E
    Dump of memory from 0x2ba371efaa40 to 0x2ba371efaaf0
    2BA371EFAA40 71EFAB10 00002BA3 0349E77F 00000000 [...q.+....I.....]
    2BA371EFAA50 00000000 00000000 00000000 00000000 [................]
    2BA371EFAA60 71B996F0 00002BA3 02050034 00000000 [...q.+..4.......]
    2BA371EFAA70 000000FF 00002BA3 00002004 00000000 [.....+... ......]
    2BA371EFAA80 00000000 00000000 2338D058 00016DAB [........X.8#.m..]
    2BA371EFAA90 00000003 00000000 085232F3 00000000 [.........2R.....]
    2BA371EFAAA0 0000000D 00000000 00000002 00000000 [................]
    2BA371EFAAB0 00000000 00000000 00000000 00000000 [................]
    2BA371EFAAC0 71EFAAD0 00002BA3 085BBFCF 00000000 [...q.+....[.....]
    2BA371EFAAD0 71EFAB10 00002BA3 0349E249 00000000 [...q.+..I.I.....]
    2BA371EFAAE0 00000000 00002BA3 00000013 00000000 [.....+..........]
    Can Anyone guide me for above Errors. How can I resolve the same.

    A quick search of Oracle Support shows that there are a handful of bugs that match ORA-07445 with an argument of kkpamDInfo()+38.
    Whether yours is already identified and patched depends on the exact version of 11.2 and the specific circumstances.
    If you're on 11.2.0.1 then this might be part of what sounds like quite a big bucket of such errors - Bug 9399991 relating to errors and dumps with SQL against partitioned tables.

Maybe you are looking for