How do I do an existence test with dbtools.h++ 
Author Message
 How do I do an existence test with dbtools.h++

Quote:

>I'm drawing a blank on how one does an existence test using SQL.
>All I want to do is ascertain whether some row in a table exists.
>I'm using Rogue Wave dbtools.h++
>How would I code this using a RWDBReader, RWDBSelector, etc.?

  Use the global function rwdbExists(const RWDBSelectorBase&).  Eg,

  extern RWDBSelector mySelector;
  extern RWDBDatabase db;
  RWDBSelector s = db.selector();
  s << "Yes it does";
  s.where(rwdbExists(mySelector));

  // etc.

  This is equivalent to the SQL  "Select 'Yes it does' where
     exists( <text of mySelector here> )

  Caveat:  there may be restrictions on what you can put into the
  exists clause.  For example, my MS SQL-Server 6.0 claims this
  is a syntax error:  "select 'yes' where exists( select name, id
  from sysobjects where id < 10 )"  It's ok if there's only one
  item selected in the inner select.  

Quote:
>Thanks

>---------------------------------------------------------------------
>Christopher Ruegger                 phone:   (301) 925-1164



--
Stan Sulsky                              

          97 Madbury Rd.            |   (603) 868-2270 - voice
          Durham, NH 03824   USA    |   (603) 868-1352 - fax


Sat, 18 Jul 1998 03:00:00 GMT
 How do I do an existence test with dbtools.h++

I'm drawing a blank on how one does an existence test using SQL.
All I want to do is ascertain whether some row in a table exists.
I'm using Rogue Wave dbtools.h++
How would I code this using a RWDBReader, RWDBSelector, etc.?

Thanks

---------------------------------------------------------------------
Christopher Ruegger                 phone:   (301) 925-1164




Sat, 18 Jul 1998 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. ADO thinks DBMS is done, but DBMS ain't done

2. Trigger doing UNLOAD to file OR calling Store Procedure doing the UNLOAD to file

3. Caché from InterSystems - doing wh at other MV vendors should be doing

4. Anyone done performance testing of the RTM yet?

5. Test is requery is done

6. OAS Scalability Testing NOT done by Oracle

7. How to test a connect string user/password@instance without actually doing the connect

8. Script to test if Update already done

9. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

10. Is this doing what I think it's doing?

11. Are We Doing A Deal Or Are We Doing A Deal ?

12. Tempdb tables - test for existence


 
Powered by phpBB® Forum Software