🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: mailing.database.mysql
1 messages
1 total messages Started by Peder Mon, 16 Jul 2001 08:49
SQL-calls to 2 databases
#1
Author: Peder
Date: Mon, 16 Jul 2001 08:49
52 lines
2772 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, LotBaseLog.TransactionName, RouteStepName, 
ResourceBaseLog.TimeLogged 
  from Lotbaselog, ResourceBaseLog 
  where LotId like '0105M3'
  and RouteStepName=1
  and Lotbaselog.timelogged=ResourceBaseLog.timelogged 

The result could be:

  LotID    TransactionName   RouteStepName  TimeLogged
  0105M3    START            1             22-06-01 13:14:34

To find the endtime:

  Select LotID, LotBaseLog.TransactionName, RouteStepName, 
ResourceBaseLog.TimeLogged 
  from Lotbaselog, ResourceBaseLog 
  where LotId like '0105M3'
  and LotBaseLog.TransactionName='COMPLETE'
  and Lotbaselog.timelogged=ResourceBaseLog.timelogged 

The result of this could be:

  LotID   TransactionName   RouteStepName   TimeLogged
  0105M3    COMPLETE       2               22-06-01 14:10:53

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

  SELECT * FROM OpenQuery(INSQL,"
  SELECT DateTime, DIR01_B1G, DIR01_B1S, DIR01_B2W, DIR01_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 is a textfile with the columns of data that I need.

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