C+ MCSDEMO2
C.
C.  Demo using "UCAC_2orig" table in MyCats DB.
C.
C.  Usage: ./mcsdemo2
C.
C-    LN 24/06/2010: v. 0.1c

      PROGRAM MCSDEMO2
      IMPLICIT NONE

      INCLUDE 'mcs_usrlib.inc'
      INTEGER LENSTR, status, DBExec_qry
      CHARACTER*200 qry

      DATA c_user /'mpe'/, c_password /'mpe2014pass'/,
     .     c_dbname /'mpe2014'/,
     .     c_query /'SELECT * FROM UCAC_2orig WHERE((htmID_6=64362 OR
     . htmID_6=64369) AND (RAcs>3568075 AND RAcs<3631925) AND (DECcs>
     . 7170000 AND DECcs<7230000))'/
C--

C- Optional arguments: the query (in "")
      CALL GETARG( 1, qry )
      IF (qry.NE.' ') c_query = qry

      WRITE(6,'("The query: "/,2X,A)') c_query(1:LENSTR(c_query))

      status = DBExec_qry('localhost')
      IF (status.EQ.0) STOP 'Error in DB operations.'

      CALL FieldInfo(0)

      CALL printValues()

      CALL DBFree
      END
      
