Returning all records for a query

Hi,
still working on this library. I have the majority of it working (not pretty but it works). One problem I have run into is that when I query an authors name I would like all records for that author to be shown. However, it is only showing the final record.
               public void Search_a()throws Exception{
          String S_author1 = JOptionPane.showInputDialog(null,"Please enter the authors name");
               String query = ("select * from library where Author=('"+S_author1+"')");
               ResultSet rs = db_statement.executeQuery(query);
               while (rs.next()) {
              String s = rs.getString("Author");
              output.setText(rs.getString("ISBN")+"\t"+rs.getString("Title")+"\t"+ s +"\t"+ rs.getString("Publisher")+"\t"+rs.getString("Genre")+"\t"+rs.getString("Details")+"\n");
          }//end while
     }// end search_aI cannot see where the error is. I think maybe I am overwriting the previous records but thought that the inclusion of +"\n" would force each result to a new line.
Any ideas?

Thanks for that. Not really sure how I would implement that (new to programming) but I have managed to solve it using               output.setText(output.getText()+rs.getString("ISBN")+"\t"+rs.getString("Title")+"\t"+ s +"\t"+ rs.getString("Publisher")+"\t"+rs.getString("Genre")+"\t"+rs.getString("Details")+"\n");Thanks for the reply though.

Similar Messages

  • Query is returning multiple records for a bank account id and party id

    Hi All,
    I am not getting why this query is returning multiple records for a particular bank account id and party id:
    SELECT instrument_payment_use_id
    ,instrument_type
    ,instrument_id
    ,start_date
    ,ext_pmt_party_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =:lv_num_ext_bank_account_id
    and exists (select 1 from iby_external_payees_all b where PAYEE_PARTY_ID= :lv_num_party_id and b.ext_payee_id = ext_pmt_party_id)
    I want above values to be used in api iby_disbursement_setup_pub.set_payee_instr_assignment in R12.
    Please help asap.
    Thanks

    O/P of query run for
    SELECT rowid, instrument_payment_use_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =6642
    AND EXISTS (
    SELECT 1
    FROM iby_external_payees_all b
    WHERE payee_party_id= 85470
    AND b.ext_payee_id = ext_pmt_party_id);
    is below:
    Rowid     INSTRUMENT_PAYMENT_USE_ID
    AABiDXAGIAABhiKAAS     236586
    AABiDXAGRAABSjtAAz     148437
    The version is R12

  • Search query returning ALL records

    DW CS3 - MS Access - ASP/VBScript
    I have a search form for records to display on the same page with keywords highlighted.  The search is returning ALL records and highlighting keywords throughout rather than returning specific records with the searched word.  What am I missing?  I'm sure it's something terribly simple.....
              <input name="search" type="text" id="search" value="<%= Request.QueryString("search") %>" />
              SELECT item, item, item, item
              FROM tbl_name
              WHERE item OR item OR item LIKE %MMColParam%
              ORDER BY sql_orderby, Date DESC
              Name: MMColParam
              Type: Text
              Value: Request.Querystring("search")
              Default Value: %

    I was using the word "item" as an example for multiple columns without actually naming them - they are not the same.  I should've used this example:
    SELECT shoes, socks, hats, gloves
    FROM tbl_apparel
    WHERE shoes OR socks OR hats LIKE %MMColParam%
    ORDER BY sql_orderby, Date DESC
    In the past, I had four duplicate query parameters for four columns which worked fine.  But since I only have one search term, I thought I could eliminate three of the duplicate parameters and use just one with the OR statement.
    In the past, you questioned me on this.  You stated, "You only have one search term and so all of the parameters have the same value, but DW still wants to creates 4 parameters. If you were coding this by hand you wouldn't do it that way, but DW's one-size-fits-all code generates four seperate parms. It's nothing to worry about."

  • Mac mail search function is not working. Any search term returns all records.

    Mac mail search function is not working. Any search term returns all records.

    hi eric. many thanks.
    i will have to read these links closer but what i meant to say is that the hard drive space that was being taken up seemed like it suddenly jumped way up because i had just gotten through a process in the last month where i am storing all my My Documents data on my Mac Pro. i am doing this in order to decide whether i should just keep it ALL on my Mac Pro and use ChronoSync to sync /some/ of it to my MBP.
    so if i look in the Documents folder on my Mac Pro i have a ton of folders that i have created with a ton of data. if i look in the Documents folder on my MBP there are NO folders that have data in them that i created. there are other folders such as folders that various software created but what i mean to point out is that there was a LOT of available space on my HD until recently.
    i am wondering if there is some way that running the Mail re-index (it then ran some kind of "Importing" routine) or by syncing my Photostream to the MBP caused a huge jump in data on this drive. if it is the photostream sync i can just take this off or see if it will sync more selectively. if it is something to do with mac mail jumping in size i am not sure why this would happen or what to do about it.
    does that question make sense?
    i mean, before i did these two operations my recollection is that i would have had 130 GB on the hard drive (really just guessing here) and now there is like 218 GB on the hard drive and i don't know where all this came from...

  • WKT polygon returns extra records on intersect query

    We have spatially enabled table with min/max lat/long with 1 degree cell data on which we perform queries coming from an application using well known text. We need to use WKT because we need to support user defined shapes of point, line, polygon, etc. (My test cases uses a rectangle). Our WKT data is accurate to 4 decimal places.
    //WKT version returns 100 records: (this is bad result)
    SELECT COUNT(*) from (select * from MAP_TABLE WHERE series='downunder') where sdo_relate(geometry,sdo_util.rectify_geometry(mdsys.sdo_geometry
    ('POLYGON((117.0627 -31.8451,117.0627 -27.0075,134.5875 -27.0075, 134.5875 -31.8451, 117.0627 -31.8451)))',8307),0.00005),'mask=anyinteract,querytype=window') = 'TRUE'
    // array version returns 90 records: (this is expected result)
    SELECT COUNT(*) from (select * from MAP_TABLE WHERE series='downunder') where sdo_relate(geometry,mdsys.sdo_geometry(2003,8307,null,mdsys.sdo_elem_info_array(1,1003,3),
    mdsys.sdo_ordinate_array(117.0627, -31.8451,134.5875,-27.0007)),'mask=anyinteract,querytype=window') = 'TRUE'
    The WKT seems to return extra records as if a .5 rounding error on the spatial query. We checked for tolerance; in USER_SDO_GEOM_METADATA, SDO_TOLERENCE for lon and lat in DIMINFO column are set to .0000005, and SRID of 8307, and the spatial index for the table has been recreated with .0000005 (just in case).
    Why is WKT not accurate?

    Hi Mike,
    Well, I'll be the first to line up and say that the WKT implementation has some issues. You already know them as you are doing that rectify_geometry step to account for some of them (incorrectly rotated rings which is what your example has).
    Noel is right that your example is not pushing along your case since an optimized rectangle is not the same as a regular rectangle, particularly in a geodetic cs. And that is one tiny tolerance in the rectify step! Is all your data at that tolerance? That's 0.0019685 inches! Wikipedia says the width of a human hair is 0.003937 inches so your tolerance is 1/3 of the width of a human hair. :)
    Anyhow, the second link Noel posted has the blurb we want: "When Spatial constructs the MBR internally for the query, lines along latitude lines are densified by adding points at one-degree intervals. This might affect results for objects within a few meters of the edge of the MBR (especially objects in the middle latitudes in both hemispheres)." So your optimized rectangle when its used internally by Oracle spatial looks like the results from this query:
    SELECT
    SDO_CS.TRANSFORM(
       MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(117.0627, -31.8451,134.5875,-27.0007)),
       8307
    FROM
    dualSo you can probably expect some differences in query results in comparison to the four point rectangle that your WKT input creates. And certainly will happen at the follicle scale!
    Could you post a different example that does not use an optimized rectangle where the SDO and WKT produce different outputs?
    If your data is stored as WKT, how did an optimized rectangle get into this story in the first place? If you need to store an optimized rectangle as WKT - well you can't do that. You could do the above transform trick on any optimized rectangles in your data and then put all the resulting points into your WKT. Then things should match on the output query side. But that would mean chucking out the whole concept of optimized triangles from your dataset.
    Cheers,
    Paul

  • Mail merge doesn't see all records in Access query

    Office 13 running on Win 8.1.
    I have a query in Access that show 4 records when I run it. If I specify this query as my data source (select recipients) and then choose to edit the recipient list, there are only two records! The query in Access looks like this:
    SELECT Membership.[m-nbr], Membership.[m-first], Membership.[m-member-since], Membership.[m-pick], Contact.[c-zip], Regions.[r-region-name], Regions.[r-region-director], Regions.[r-region-email], Membership.[m-member-since], Associates.[a-first-name], Associates.[a-id]
    FROM ((Membership INNER JOIN Contact ON Membership.[m-nbr] = Contact.[c-nbr]) INNER JOIN (Regions INNER JOIN [Region/State] ON Regions.[r-region] = [Region/State].[rs-region]) ON Contact.[c-state] = [Region/State].[rs-state]) LEFT JOIN Associates ON Membership.[m-nbr]
    = Associates.[a-nbr]
    WHERE (((Membership.[m-pick])=True) AND ((Associates.[a-id]) Like "*A" Or (Associates.[a-id]) Is Null) AND ((Year([m-member-since]))=Year(Date())))
    ORDER BY Contact.[c-zip]; 
    If I remove this part: "((Associates.[a-id) Like "*A" Or (Associates.[a-id] is Null AND" then all 4 records show up in the recipient list.
    In short, members can have multiple associates, but only the"A" associate is to be included in this letter. (associates have the same number as the member, with an a,b,c etc. appended. A member number could be 8741 and an associate number 8741A. 
    Why is this happening? Thanks, ~Steve
    Steve Woodward

    Hmm, I tend to work in SQL mode when creating queries in Access - in that case, it doesn't change what you write. But I see that in the tabular Design mode it does change to ALIKE and that it works OK - something I wasn't aware of. I read that ALIKE is supposed
    to allow "%" and "_" even when the database is in "Jet mode. 
    FWIW in ANSI mode, I would not expect LIKE "%a" to work in Access but it should work from OLE DB
    But in any case, it still works OK here, so still not sure what is wrong.
    As a workaround, it might be necessary either to export the query results from Access, then use the exported data as your source, use the query to create a new table and use that as the data source, or connect using DDE (to do that, in Word, you have to
    check Options->Advanced->General->Confirm file format conversion on open. Then go through the connection process again and select the .accdb/.mdb. If it's a .accdb, you will have also have to check "Show all" when you get to the "Confirm Data Source"
    dialog box. At that point, you need to select the "MS Access Databases via DDE" option from the list (even if you have a .accdb, which isn't listed in the file types for that connection method).
    All of these approaches have their disadvantages (e.g. DDE may not connect easily and probably won't return Unicode data correctly) but may at least give you another avenue of investigation.
    Peter Jamieson

  • Parameter in select to returns all records.

    Post Author: ComputerMike
    CA Forum: Crystal Reports
    Hi,
    I have a "project" parameter I use in my select formula to return records based the project field.  I would like to pass a value like "All" or "*" and have all reords returned, to see the records for all the projects.  If I pass in "3" I would just get records for project 3.  "All" would give me all the projects.
    Thanks,
    Mike

    Post Author: GraemeG
    CA Forum: Crystal Reports
    Modify your selection formula to something like:
    (if {?project} <> "ALL" then   {table.project} = {?project}else   1 = 1)
    You have to specify an 'else' and the above is a cheat that makes sure everything is selected if 'ALL'  is entered. A suggestion - make 'ALL' your parameter default.

  • Count all records in a query

    Hi all,
    I have a query for debtors. This query is working fine. In query output, I just want a number that contains total no of records present in a query. How can i do that? Is that possible in BI??
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd

    Just create a New formula in the querry and put in the formula... in the result column u will get the desired out put....
    Khaja

  • Returning no records when changing query setFirstResult value

    On 1st pass through I can get the number of results based on setFirstResult and max number of records is set to 2 for testing. As a note setFirstResult() seems to be zero-based in that I have to set 1st result to 0 to get the 1st 2 records.
    I remove the query from session since I read we could not re-use the query if setting the first result. Then I always create a new query and set the 1st result to the 1st row of next page which would be 2. I have 4 records that match in the database, but never get any results back.
    Any help would be really appreciated !
    Here's my code:
    if (_databaseSession.getQuery(HOGLConstants.NAMED_QUERY_BY_PHONE) != null){_databaseSession.removeQuery(HOGLConstants.NAMED_QUERY_BY_PHONE);
    createSearchByPhoneQuery(_databaseSession, searchByPhoneDTO, requestedPage, _maxRowsPerScreen);
    Vector supplements = (Vector)databaseSession.executeQuery(HOGLConstants.NAMED_QUERY_BY_PHONE,_searchByPhoneDTO.getAreaCode(),_searchByPhoneDTO.getPhoneNo());
    private void createSearchByPhoneQuery(DatabaseSession databaseSession, SearchByPhoneDTO searchByPhoneDTO, int requestedPage, int maxRowsPerScreen) {
              int firstRecordRow = (requestedPage - 1) * _maxRowsPerScreen;// setFirstRecord(int) is zero-based even though API does not mentionit.
              ReadAllQuery _query = new ReadAllQuery(SuppReq.class);
              ExpressionBuilder builder = query.getExpressionBuilder();
    //          Define two expressions that map to the applicant's area code and phone number
              Expression areaCodeExpression =     builder.get(HOGLConstants.PERSISTAPPLICANT_AREA_CODE).equal(_searchByPhoneDTO.getAreaCode());
              Expression phoneNoExpression = builder.get(HOGLConstants.PERSISTAPPLICANT_PHONE_NO).equal(_searchByPhoneDTO.getPhoneNo());
              _query.setSelectionCriteria(areaCodeExpression.and(phoneNoExpression));
              query.setMaxRows(HOGLConstants.SEARCHRESULTS_ROWS_PER_SCREEN);
              query.addAscendingOrdering (HOGLConstants.PERSISTSUPP_REQ_ID);
    //          Specify the required arguments for the query
              query.addArgument(HOGLConstants.PERSISTAPPLICANT_AREA_CODE);
              query.addArgument(HOGLConstants.PERSISTAPPLICANT_PHONE_NO);
              query.setFirstResult(firstRecordRow);
              query.setQueryTimeout(HOGLConstants.QUERYTIMEOUT);
              databaseSession.addQuery(HOGLConstants.NAMEDQUERY_BY_PHONE, _query);
         }

    Hello,
    The max rows operation is applied independently from the firstResults opperation, and is applied first. So in setting max rows to 2, you are getting rows 1 and 2, and then by applying firstResults=2, you are skipping past the second row, hence getting 0 back. This is because Max rows is applied to the statement before execution, where as firstResult is applied to the returned resultset. You will need to use firstresults=2 and maxrows=4 to get rows 3+4.
    Also, you can change the query parameters on a named query. It is not recommended though only because named queries are stored on the session, and so in a multi-threaded app can cause problems when two threads try to execute the same query with, for example, different max results set. In a multithreaded environment you might want to get the named query and clone it before changing first/max rows, but for single threaded app there shouldn't be any problems.
    Best Regards,
    Chris

  • Display count of all records in a query on VC

    Hi all,
    I have a query for debtors. I want that on VC, only the no of document present in that query should be displayed instead of all documents in a chart or table. Is that possible on dash board? If yes then how??
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    If it's an SQL query then do a: "select count(*) from table_debtors where ......"
    Or you can use the Sigma operator. Just add this between your data source and the output table. When configuring the operator choose "count" for the fields.
    Henning
    Edited by: Henning Strand on Jan 22, 2008 8:04 AM

  • Return all Groups for Outer Join + Count + Group By

    I have two tables, TC and XEA. The relationship is one TC to many XEA. TC is a lookup table and has one field, the code field TCSI_CD. XEA has the same code field called BAM_TCSI, which is the joining key, and also another field, the date field, LOAD_DATE.
    I want to generate a report counting the records in XEA and grouping by the code list in TC. When a TC code is not found in XEA, the report must show a count of zero. The SQL shown does not work, as codes not found in XEA are omitted. Thanks in advance for any help.
    SELECT
    TC.TCSI_CD,DECODE(COUNT(XEA.BAM_TCSI),NULL,0,COUNT(XEA.BAM_TCSI))
    FROM
    OB_TCSI_CD TC,
    TEMP_OB_XEA_HIST XEA
    WHERE
    TC.TCSI_CD = XEA.BAM_TCSI(+) AND
    XEA.LOAD_DATE > '1-JUN-2002'
    GROUP BY
    TC.TCSI_CD

    You need to include a (+) after the load_date column. If you omit that, it negates the whole outer join and turns your query into an inner join. Then just a regular count will work, returning 0 for the null values. You also might want to use the to_date function, instead of relying on your session having the matching nls_date_format.
    SELECT   tc.tcsi_cd,
             COUNT (xea.bam_tcsi)
    FROM     ob_tcsi_cd       tc,
             temp_ob_xea_hist xea
    WHERE    tc.tcsi_cd = xea.bam_tcsi (+)
    AND      xea.load_date (+) > TO_DATE ('1-JUN-2002', 'DD-MON-YYYY')
    GROUP BY tc.tcsi_cd

  • Get PERAS Returning Mulitple Records For PERNR

    I have a program that is preloading PNPPERNR with PERNRS from a database before the GET PERAS statement.  We just did an upgrade of some of our HR SAP Components and now the GET PERAS statement is triggering every time if sees a given PERNR in the PNPPERNR whereas before it only did it once even though the number of PERNRS in the PNPPERNR table is exactly the same.
    We upgraded all of our SAP-HR* components from Release 604 SP-Level 67 to SP-Level 75 and the EA-HR* from Release 605 SP-Level 0044 to SP-Level 0052.   We've tested the program in a client that hasn't been updated and then ran in an updated one and that is how we found the problem.  Obviously SAP has updated something.  Has anybody experienced this problem?

    Hello,
    The max rows operation is applied independently from the firstResults opperation, and is applied first. So in setting max rows to 2, you are getting rows 1 and 2, and then by applying firstResults=2, you are skipping past the second row, hence getting 0 back. This is because Max rows is applied to the statement before execution, where as firstResult is applied to the returned resultset. You will need to use firstresults=2 and maxrows=4 to get rows 3+4.
    Also, you can change the query parameters on a named query. It is not recommended though only because named queries are stored on the session, and so in a multi-threaded app can cause problems when two threads try to execute the same query with, for example, different max results set. In a multithreaded environment you might want to get the named query and clone it before changing first/max rows, but for single threaded app there shouldn't be any problems.
    Best Regards,
    Chris

  • Hi how will get subquery returns multiple values for main query

    Hi all ;
    here i given one sql query
    1)select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '|| initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b.name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100;
    if i run this above query returning multiple values depend on sa.mgr values.
    like output coming like this
    yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    2) this sub query i am passing with main query
    select sa.mgrid,sa.sal,(select decode(a.FLG,'Y','yes','N','no','null')||'] '||a.p_type||' : '||
    initcap(replace(substr(b.mgr,0,instr(b.mgr,'@')-1),'.',' '))||' - '||
    b .name||' ('|| substr(a.name,0,instr(a.name,'-')-1)||')'
    from table1 a
    join table3 c on c.emptype = a.emptype
    left outer join table2 b on a.name = b.name
    where a.mgrid = 100)" test " from table4 sa,table5 te ,table6 ft where sa.id(+)=te.id and sa.mgr=ft.mgr;
    my final out put required like this:
    mgrid sal test
    100 20000 yes:2000-anbarasan
    yes:2700-anb
    yes:2000-rasan
    yes:2807-anbarasan
    yes:2700-anbanu
    yes:2000-null
    but i am getting erro:
    1)missing paranths
    2)single row subquery return more then one row.
    hi kindly give me answer to me as soon as possible
    Edited by: anbarasan on Sep 29, 2008 9:48 PM

    I refuse to read all of that code and guess what error message you are getting. Apparently others feel the same way.
    Run the final SQL statement and then cut and paste the code and full error statement into a post.
    Also include your full version number to three decimal places.
    My refusal is not an unwillingness to help you but rather an unwillingness to spend 10 minutes reconstructing what you could have pasted in in a fraction of a second. We are all volunteers here and there are many people that need help. I hope you understand.

  • Duplicate records for Dynamic Query in WLS 7

    I am getting duplicate records back when I run a dynamic query. If I run the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE b.userId = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have for the same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table; company_id 2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same query for a
    finder method works fine?
    Thanks for your help.

    Thanks Greg, that worked!
    "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
    You can supply properties on the query request, perhaps there is a
    SQL_SELECT_DISTINCT property:
    Properties p = new Properties();
    p.setProperty("GROUP_NAME", "fieldgroup");
    p.setProperty("INCLUDE_UPDATES", "true");
    p.setProperty("SQL_SELECT_DISTINCT", "true");
    Collection people = myQuery.find(
    "SELECT OBJECT(o) FROM PersonCMPEJB o WHERE o.lastName = 'Smith'", p);
    -Greg
    Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
    www.amazon.com/exec/obidos/ASIN/1931822468 or www.titan-books.com
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Matt,
    <sql-select-distinct> needs to be set in <weblogic-query> element. I amgenerating
    a dynamic query from within a local client. So I don't have a finderdefined for
    this method. (I don't want to define a finder for this method). How doyou suggest
    I can use this? Thanks again for your help.
    Matthew Shinn <[email protected]> wrote:
    Hi Mike,
    I just filed a bug report for this (CR079471). As a work around, you
    can
    use the
    setSQLSelectDistinct flag so the database will weed out the duplicates.
    The only thing to
    look out for when using this flag is that Oracle will not allow the use
    of 'SELECT DISTINCT'
    in conjunction with a 'FOR UPDATE' clause, thus,<sql-select-distinct>True
    CANNOT be used if
    any Bean in the calling chain has a method with <transaction-isolation>
    set to
    <isolation-level>TRANSACTION_READ_COMMITTED_FOR_UPDATE. Sorry for theinconvenience.
    - Matt
    Mike wrote:
    I am getting duplicate records back when I run a dynamic query. If
    I
    run
    the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE
    b.userId
    = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have forthe same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table;
    company_id
    2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same
    query
    for a
    finder method works fine?
    Thanks for your help.

  • Sql to return second record in a query first

    I have a query that simply retruns records ordered by date
    most recent. What
    I need is to show the second record in the set only, or
    first. How would I
    do that?

    Make the inner join a LEFT JOIN
    SELECT        (ct.amount)
    FROM            dbo.card AS c WITH (NOLOCK) LEFT JOIN
                             dbo.card_transaction_log AS ct WITH (NOLOCK) ON ct.card_id = c.card_id  AND ct.transaction_response_cd = '00' AND 
                             ct.transaction_type_cd = 'REDEMPTION' AND ct.lastupdated <= '2013-12-09 11:02:00'
                             where c.card_id IN 
                             1767811,
                             1767812,
                             1767813 )
    Tom
    P.S.  Using WITH (NOLOCK) is usually a bad idea.  It amounts to saying you don't care if you might get bad data, duplicate data, missing data or unexpected errors.  If you are not having blocking problems, you don't need WITH(NOLOCK) and if
    you are having blocking problems it is usually better to look for other solutions, like improving your indexing strategy or using the SNAPSHOT transaction isolation level.
    Tom

Maybe you are looking for

  • Error while exporting website

    Hi, I am trying to export a website using the Administration --> Site Studio Administration --> Backup and Restore link. It starts exporting, but after some time it aborts saying Abort exporting due to too many errors. When i checked the server outpu

  • B1iF 1.5 SQL Call problem with result transformation

    Hi all, i've made a scenario that reads a text file, and for each line, mak an sql call to find corresponding CardCode. Everything is ok until i want to transform the result of the SQL Call. Here is the result message <?xml version="1.0" encoding="UT

  • VOFM Routine Copy in ECC 6.0

    Hi, When I copy a VOFM routine in ECC 6.0 (say billing document routine 001 copied to 901) to a custom routine, I see some messages regarding the existing enahancement points & sections, which do not allow me to activate the copied routine. Can any o

  • 1001 glitches in OS X Lion

    Ok, I admit it.  The title of this post it a tad dramatic.  Perhaps I'm in a bad mood.  This is extremely possible.  One of the reasons for this is that my laptop that I used to enjoy using so much is now a real pain.  The few things that I like abou

  • XSQL and basic flow control

    Hello again, Is there any mean to execute more that one time the same XSQL action-element, like this (future XSQL version?): <xsql:for-each test="{@selectedITEMS}"> <xsql:dml> DELETE FROM ITEMS WHERE ItemID = {.} </xsql:dml> </xsql:for-each> Yes the