Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Agro42

    SQL return code in VBscript

    I managed to get what I needed. This is what my code looks like: dim sqlstring dim err sqlstring = "insert into atpa...." Set rsATPA = CreateObject("ADODB.REcordSet") On Error Resume Next set rsATPA = Conn.Execute(SQLstring) retcode=0 on error goto 0 If conn.Errors.count <> 0 Then retcode...
  2. Agro42

    SQL return code in VBscript

    Ok, I've searched the web with Google, and I've read over 100 Q&As on this forum, but I can't find anywhere how to get the SQL return code out of a recordset after an insert. I am doing inserts of records that come from an outside vendor, and they often send records with duplicate keys. I want...
  3. Agro42

    Update using join of 2 tables

    Marc, I was expecting the 'F' to be set only where there was a matching fail record on the ATPA table, and left with the already set ' ' when there was no fail record. My problem was that I had to compare both stulink AND testlink for each record, which messed me up when I used IN (select...)...
  4. Agro42

    Updating Multiple fields with Table Joins

    Change this bit: WHERE AIM.AIMRetrievedItem.ArchiveRetrievalID = (SELECT AIM.AIMRETRIEVEDITEM.ARCHIVERETRIEVALID FROM to WHERE AIM.AIMRetrievedItem.ArchiveRetrievalID IN (SELECT AIM.AIMRETRIEVEDITEM.ARCHIVERETRIEVALID FROM
  5. Agro42

    Union queries in DB2 Newby

    I've hit the limit on mainframe DB2 (on older versions of DB2 admittedly) of 16 unions.
  6. Agro42

    Update using join of 2 tables

    I'm getting closer. This code UPDATE APRF3951 SET (passfail, testdate) = (Select Distinct 'F', max(ATPA3951.admdate) From ATPA3951 Where APRF3951.stulink = ATPA3951.stulink AND APRF3951.testlink = ATPA3951.partnum AND ATPA3951.testlink in (61, 62, 63) And (ATPA3951.scoreone like '%N%' or...
  7. Agro42

    Update using join of 2 tables

    The INNER JOIN clause is something I've never used before. I was taught to join my tables in the WHERE clause but all the stuff I found searching the web said I needed an inner join. My original update looked like this: update aprf3951 a set (a.passfail, a.testdate) = (select 'F', b.admdate from...
  8. Agro42

    Update using join of 2 tables

    I need to update 1 table from another table. Simple enough, but I can't get it to work. Here are my tables and the important fields: APRF stulink testlink passfail testdate ATPA stulink testlink (not the same as APRF.testlink) partnum (IS the same as APRF.testlink) scoreone admdate There is no...
  9. Agro42

    Need to update 1 table from another

    I managed to get it to work. It was a wierdo. Apparently I needed to have a join both inside my subselect and outside the subselect. Without that, I was doing a non &quot;correlated update&quot;. My SQL wound up looking like: update astu3201 set engprof = (select epscode from eps_codes...
  10. Agro42

    Need to update 1 table from another

    Nope. EPSCODE is defined as NOT NULL WITH DEFAULT. Any other suggestions?
  11. Agro42

    Need to update 1 table from another

    I need to update a DB2 table with values from a temporary table, populated from a file. The ASTU is my student record table, the EPS_CODES is my temp table. ASTU contains about 100 fields, the only one of which I need to update is named ENGPROF. The PK is PERMNUM. EPS_CODES has 3 fields...

Part and Inventory Search

Back
Top