🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: dk.edb.database
1 messages
1 total messages Started by Peder Tue, 17 Jul 2001 15:36
InSQL-calls to 2 databases
#1
Author: Peder
Date: Tue, 17 Jul 2001 15:36
53 lines
3083 bytes
Dear group,

I hope someone can help me out...

I call a SQL-database to get starttime and endtime for a process on a given 
product (=LotID)

To find the starttime:

  SELECT LotID, Lot.Transaction, Route, Resource.Time 
   FROM Lot, Resource
  WHERE LotId like '0105M3'
   AND Route=1
   AND Lot.time=Resource.time

The result could be:

  LotID    Transaction      Route          Time
  0105M3    START            1             22-06-01 13:14:34

To find the endtime:

  SELECT LotID, Lot.Transaction, Route, Resource.Time
   FROM Lot, Resource
  WHERE LotId like '0105M3'
   AND Lot.Transaction='COMPLETE'
   AND Lot.time=Resource.time

The result of this could be:

  LotID   Transaction     Route           Time
  0105M3    COMPLETE       2               22-06-01 14:10:53

Then I use these times (Time) to call another database on the same 
server. For this I need to use ODBC:

  SELECT * FROM OpenQuery(INSQL,"
  SELECT DateTime, B1G, B1S, B2W, B3G
   FROM Runtime.dbo.AnalogWideHistory
  WHERE DateTime >= '22-06-01 13:14:34'
   AND DateTime <= '22-06-01 14:10:53'
   AND wwresolution=100
  ")

The result are the columns of data that I need:

  DateTime   B1G   B1S   B2W    B3G


I need to do this maneuvre in one go, and not via many calls. Is there a way to 
do this? 

mvh Peder / www.nst.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads