JDBC: How  to select only those records which contains col1 is NULL

Hi All,
In JDBC SELECT scenario.
I wants to select only those records which contains col1 is NULL.
I am trying as follows:
<key>
<col1 isNull="TRUE" />
</key>
but in moni/monitoring i am getting Following Error
006-12-01 19:35:20 Error Unable to execute statement for table or stored procedure. 'BG_SALARY_SEND_SAP_D' (Structure 'SELECT') due to java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
2006-12-01 19:35:20 Error Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'BG_SALARY_SEND_SAP_D' (structure 'SELECT'): java.sql.SQLException: FATAL ERROR document format: structure 'SELECT', key element 'key' contains no values
Please suggest how to do select rows with col1 is null.
Regards

Rohan,
isNull= true is used to make the KEY element not mandatory.
In your case, if the select query is
select emp from emptest where empno is null
, then the datatype will be,
<root>
<StatementName>
<dbTableName action=”SELECT”>
  <table>emptest</table>
<access>
<emp></emp>
</access>
<key1>
<b><empno hasQuot="NO">is null</empno></b>
</key1>
</dbTableName> 
</StatementName>
</root>
I dont have a DB access to try this, but I think this should work.
If this doesnt work, then you would need to use SQL_QUERY,
<root>
<StatementName>
<anyName action=” SQL_QUERY”>
<access>select emp from emptest where empno is null</access>
</anyName > 
</StatementName>
</root>
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Regards,
Bhavesh

Similar Messages

  • HOW TO SELECT ONLY THOSE RECORDS WHERE NOT AVAILABLE ON SECOND TABLE

    hi
    i have two tables one name is menus and second name is UGroupDetail. Actually i have created it for user role privileges for my application
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[Menus] Script Date: 03/28/2015 13:45:27 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Menus](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL,
    CONSTRAINT [PK_Menus] PRIMARY KEY CLUSTERED
    [RightID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    second table is
    USE [LedgerDB]
    GO
    /****** Object: Table [dbo].[UGroupDetail] Script Date: 03/28/2015 13:46:12 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[UGroupDetail](
    [RightID] [int] NOT NULL,
    [RightName] [nvarchar](200) NULL,
    [GroupID] [int] NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_Menus] FOREIGN KEY([RightID])
    REFERENCES [dbo].[Menus] ([RightID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_Menus]
    GO
    ALTER TABLE [dbo].[UGroupDetail] WITH CHECK ADD CONSTRAINT [FK_UGroupDetail_UserGroup] FOREIGN KEY([GroupID])
    REFERENCES [dbo].[UserGroup] ([GroupID])
    ON UPDATE CASCADE
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[UGroupDetail] CHECK CONSTRAINT [FK_UGroupDetail_UserGroup]
    UGroupDetail have many groups as assigned to a new user but Menus table has only default groups which is 90 records
    Menus table is a primary table and UGroupDetail is a Foreign key table
    now i want to combined these tables and want to get only remaining records for each group
    for example i have assigned 5 roles to GroupID 2 and now when i apply select commands the result should be 85 out 90 for GroupID 2
    but i have not idea how to modify select query for get desired result

    I don't really understand the tables. What is GroupID doing in the Menues table? And what does an entry without a RightName mean? Shouldn't that column be NOT NULL?
    The UGroupDetail does not have any primary key. From your description, I would expect the PK to be (RightID, GroupID). But strangely enough, GroupID is nullable. So is RightName, but I think this column is redundant and should be removed.
    Anyway, if I understand your question correctly, you need something like:
    SELECT UG.Name, M.RightName
    FROM   UserGroups UG
    CROSS  JOIN Menus M
    WHERE  NOT EXISTS (SELECT *
                       FROM   UGroupDetail UGD
                       WHERE  UG.GroupID = UGD.GroupID
                         AND  UG.RightID = M.RightID)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to select only one record at a time in ALV

    Hi all,
    I have to use ALV report.  Each record on the report output should have a button (or radio button) which will allow the record to be selected.  My requirement is to select only one record at a time.
    please guide me how to proceed further.
    regards
    manish

    hi
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sampleCheckBoxProgram
    Regards
    Pavan

  • Select only those images which are in a Stack

    Hi.
    Is there any way to filter the Browser view to show only those images which are in a stack?
    I often make a few details (cropped versions) of Masters, which I keep stacked with the Master. I would like to filter my Browser view to show either only those Stacks, or, alternatively, only those Versions which are not in a Stack.
    Slightly more complicated: I have many whole-Library Smart Albums which pick up the cropped Versions (by Keyword). Some of these cropped Versions have become detached (un-Stacked). I would like to be able to filter these Smart Albums for Versions which are not part of a Stack.
    Even more complicated: I would like to filter the same Smart Albums for Versions which have Stack-mates in the same Smart Album -- that is, I would like to identify within the Smart Albums those Versions which share a Master. I've made this slightly easier by Stacking the Versions with the Master, but I don't know how to filter an Album for those Stacks which contain two or more Versions.
    In short, I'm looking to access the properties "Is in Stack" (or whatever Aperture calls it), and "Number of Stack-mates in Stack in this view" (or whatever Aperture calls it). Aperture knows this -- it is displayed visually -- but I don't how to access it.
    Thanks.

    Thanks for the reply, Allen. That's all I've been able to figure out. It would nice (and, imho, proper) for Aperture (a DBMS) to provide user access to all properties.

  • How to get only the record which is different by outer join

    Hi,
    how to get the values Existing in table A which are not existing in table B by using left outer join, In this example only the record '3' should display. thanks
    the requirementment is like
    Table A.Number Table B.Number
    1 1
    2 2
    3 4
    4 5
    output
    3

    SQL>  with a as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 3 a from dual union all
    select 4 a from dual
    b as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 4 a from dual union all
    select 5 a from dual
    select a.*
      from a left outer join b on (a.a = b.a)
    where b.a is null
             A
             3

  • Regarding Select query to select only 1000 records in Internal Table.

    Hello Friends,
    Please explain me to how to Select only 1000 records from data base table?
    For Example
    SELECT *  INTO TABLE ITAB                          OR            SELECT * INTO ITAB 
         FROM EKKO                                                                  FROM EKKO
    WHERE EBLEN IN S_EBLEN.                                            WHERE EBLEN IN S_EBLEN
    (Currently i am using)                                                       UP TO 1000 ROWS.
                                                                                    ENDSELECT.  (I do not want to use)
                                                                                    In this case Internal table may be store more then 1000 records. But i want to select first 1000 records.
    Please explain me.
    Regards
    Amit

    Hi,
    TABLES : ekko.
    selection-screen begin of block b1 with frame title text_t01.
    SELECT-OPTIONS: S_EBELN for ekko-EBELN.
    selection-screen end of block b1.
    DATA itab TYPE STANDARD TABLE OF ekko.
    SELECT *
      FROM ekko
      INTO TABLE itab
      UP TO 1000 ROWS
      WHERE EBELN IN S_EBELN.
    Thanks,
    Sri.

  • Selecting ONLY those fiels that need metadata written?

    How do I select ONLY those images that need the metadata written? I've got 40,000 images, change a number of keywords for different groups - add, delete, rename, whatever. I DON'T want to have to save metadata for all 40,00 files 'cause LR is already so slow... And doing a save metadata for every group I change is painful 'cause it takes foreve just to update even a few files. I've got the preference turned on to automatically write changes to xmp, but I'm not working with anything that has sidecar files...
    I want to be able to JUST select those images that need the metadata written out, then let it spend all night writing the changes.

    Thanks Lee... But, that doesn't appear to be what I'm seeing. I've got autowrite on (at least as far as I know I do), but I can watch a set of files where I've made changes to keywords and even after all activity has stopped there'll be files with the metadata indicator showing they haven't been synchronized with the disk.... AND, I can go to Bridge and open one of these files and see that the keywords haven't been updated on the disk......
    So, even though I have autowrite on, I can't be SURE the changes actually got written. And last night I selected everything and did a "Save metadata"... Just over 12 HOURS later it was at the 3% completed... This was on a catalog of approximately 35,000 images.
    This is why I'd like to be able to just select those images needing updating. Hopefully, it'd be faster.

  • Showing only those Keyfigures which has some values

    Hello Experts,
    We've the following layout:
                Jan     Feb      Mar       Feb
    KF1
    KF2
    KF3
    KF4
    Need: On the start of the application, I only want to only those KF's, which has any value. and later if the user wants, they can add that back.
    How can we achieve this functionality ?
    Thanks & regards,
    Jomy

    Hi Tammy,
    It was nothing specific to Planning.
    I was just giving a use case.
    The idea is to show only those Keyfigures which has some values but later I should have the ability to add it back to the view.
    I would really appreciate your help in this.
    Thanks & regards,
    Jomy

  • Anyone know how to select only even or odd numbered files in lightroom?

    Anyone know how to select only even or odd numbered files in lightroom? I need to reduce the quantity of images in my timelapse sequence and this would help me greatly since there are 8250 images and doing this maually would be tediuos and make me want to kill myself.... : )

    Do this.
    If they are jpegs, use .jpg instead of CR2
    Be sure to save this as a preset, as you WILL need it again. Mine is named "select even CR2", that is why it says that in the upper right.

  • How to select the first record?

    Hi,
    Could anyone tell me how to select the first record of every
    group?
    ex, I want to find out every customer their first purcaseDate.
    CustomerID PurcaseDate Region
    A00000001 2001/01/01 AA
    A00000001 2001/02/02 AA
    A00000002 2001/03/01 AC
    A00000002 2001/05/07 AC
    A00000003 2001/03/05 DD
    result:
    A00000001 2001/01/01 AA
    A00000002 2001/03/01 AC
    A00000003 2001/03/05 DD
    Thanks

    Vincent,
    You could do it as Carl suggested, with a couple of
    corrections.  You would need to include the CustomNo column in
    the order by clause of your cursor.  You would also need to add
    a where clause to your update statement, otherwise everywhere
    Region in the table would be updated with the same value of the
    last CustomNo in the cursor, regardless of the CustomNo in the
    table.  See corrected code below:
    DECLARE
      CURSOR     cust
      IS
      SELECT     DISTINCT CustomNo, Region, Purchase_Date
      FROM       my_table
      ORDER BY   CustomNo, Purchase_Date, Region;
      c_customer VARCHAR2 (9) := '...';
      c_region   VARCHAR2 (2) := '..';
      cntr       NUMBER := 0;
    BEGIN
      FOR x IN cust
      LOOP
        IF x.CustomNo != c_customer
        THEN
          c_customer := x.CustomNo;
          c_region := x.Region;
        ELSE
          UPDATE my_table
          SET    Region = c_region
          WHERE  CustomNo = c_customer;
          cntr := cntr + 1;
          IF cntr = 25
          THEN
            COMMIT;
            cntr := 0;
          END IF;
        END IF;
      END LOOP;
      COMMIT;
    EXCEPTION
      WHEN OTHERS THEN 
        NULL;
    END;
    Another option is that you could just use one update statement,
    like this:
    UPDATE my_table a
    SET    Region =
           (SELECT DISTINCT Region
            FROM   my_table b
            WHERE  (CustomNo, Purchase_Date) IN
                   (SELECT   CustomNo, MIN (Purchase_Date)
                    FROM     my_table
                    GROUP BY CustomNo)
            AND    a.CustomNo = b.CustomNo)
    Barbara

  • How to select rows whose one column contains some specific characters ?

    These is a table say T1 with a column say C1
    Let the field C1's values be:
    row 1)DE/SPT/A/FWD
    row 2)G/SPT/DE/DE/SPT
    row 3)R/FWD/SPT/A/FWD/FWD
    row 4)A/A/DE/SPT/FWD
    row 5)FWD/SPT/E/DE/A
    How to get only those rows whose C1 column contains FWD in last ?

    We can solve this with the simple use of a wildcard:
        select *
        from t1
        where c1 like '%FWD'
        /Note that this query will execute a full table scan, because any index you may have on C1 will be ignored: indexes are organised on the leading characters.
    cheers, APC

  • How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available? Kindly help

    How can I Sync a folder (which contains all types files, sub folders and weighs some gigs) through wifi or USB ( and not using cloud services) between my New Ipad and Win 7 PC? Any apps available?
    kindly suggest a solution.
    Thank you inadvance!

    You can only import photos/videos via USB and the camera connection kit.
    ITunes: Syncing media content to your iOS devices
    http://support.apple.com/kb/ht1351
     Cheers, Tom

  • How to call a Oracle Proc,which contains Object Type as in Param, from java

    Hi
    Would like to know how to call a Oracle Procedure which contains the Object Type Parameter from java.
    Here is my code will look like...
    1. CREATE OR REPLACE TYPE emp AS OBJECT
    Empno NUMBER,
    Ename VARCHAR2(50)
    [COLOR=royalblue]In step1 I have created object type.[COLOR]
    2.CREATE OR REPLACE PACKAGE ref_pkg IS
    TYPE tab_emp IS TABLE OF emp;
    END ref_pkg;
    [COLOR=royalblue]In step2,I have created a table type which is of type emp;[COLOR]
    3. CREATE OR REPLACE PROCEDURE p_emp(p_emptab IN ref_pkg.tab_emp) as
    BEGIN
    FOR I IN 1..p_emptab.COUNT
    LOOP
    Some code written here
    END LOOP;
    END;
    [COLOR=royalblue]In step3 I have passed tabletype which is of type emp as argument.[COLOR]
    Now I need to invoke this procedure from JAVA.
    Calling a procedure doesn�t matter.
    But how I can map objecttype ? how will java recognize oracle object ?
    How can I implement this ?
    Any Help/Clues is Appreciated.
    Thanks
    Krishna

    Hi Bob
    You can call a stored proc from a database control with the jc:sql annotation itself.
    Assume a stored proc taking one In parameter
    * @jc:sql statement="call sp_updateData({id})"
    void call_sp_updateCust(int id);
    You can even call stored proc with OUT parameters using
    * @jc:sql statement="{call sp_MyProc(?, ?)}"
    void call_sp_MyProc(SQLParameter[] params)
    You can also call stored functions via db control.
    More info and diff ways to call at
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
    Thanks
    Vimala

  • I should have said in my previous message that the iphoto program I am using is for an ipad 2.  I simply want to know how to delete an edited album which contains one photo that I do not want taking up space.

    I should have said in my previous message that the iphoto program I am using is for an ipad 2.  I simply want to know how to delete an edited album which contains one photo that I do not want taking up space.

    OK....I'm stumped.  The message you are seeing is typically there to protect someone from syncing with a different computer/iTunes account.  Is there any way anyone else has used your iPad and possibly connected it to their computer?

  • URGENT: Selecting only 25 records at a time from a table

    URGENT !!!!
    Hi,
    Im having a RFC which selects records from a table (say table_A) and depending on these selected records, further processing is done within that RFC.
    Now my problem is, this table_A contains around 200 matching records. Due to this entire logical processing consumes lot of time. Hence my RFC is taking huge time to produce result. (apprx 10 mins).
    Can i select these matching records in batch of 25 and display result for these 25 records??
    I'll give this batch size as input to RFC?
    Do anybody have any idea about how to tackle this situation and reduce response time?
    If u hav any better solution than this then pls pls let me know ASAP..
    Regards,
    Amey

    Amey Mogare  ,
                             Do One thing , create  a new importing parameter in your RFC , say current_trans_id. NOw on the first call pass the initial value for current_trans_id.
    then inside the logic .. change the select to
    select upto 25 rows where trnascation id > current_trans_id.
    next time when u call teh rfc.. send the last selected id as a value for current_trans_id.
    i think you can some how use this logic
    Regards
    Sarath

Maybe you are looking for

  • How can i get a new id by my iphone without loosing all apps

    Hi, I have an iphone which is connected over the ID of my ex-boyfriend. Now I want to know if it is possible to get a new ID for my phone without loosing all Apps and dates?? Thanks a lot

  • Save as Using Passthrough?

    When using "Save as" with the self-contained movie option, does QuickTime simply passthrough the audio and video tracks to a mov container or is it re-encoding the tracks while moving them to the mov container? I have an mkv video with an h.264 video

  • Virtual Key Figures in RSR_OLAP_BADI not re-calculated correctly

    Hello BW/BI Experts!     Please clarify why is the COMPUTE METHOD of RSR_OLAP_BADI not triggered or executed if you remove a drilldown to a certain characteristic.     For instance, my query is drilled down by customer and material by default. Upon o

  • Connection Exceeds

    hi I am using SQl Server and JRUn for My application When I tried to Connect to the Sql Server thro JSp - i Encountered the Following Error in some times Login failed - The maximum simultaneous user count of 10 licenses for this server has been excee

  • HT3187 Apple tv 1st generation does it have netflix, hulu?

    Does Apple Tv 1st Generation have all the available items that the latest apple tv?  Netflix, hulu? and if so how can I update it so it shows up on my device?