🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.oracle.server
Article #81

SQL-calls to 2 databases

#81
From: Peder
Date: Tue, 17 Jul 2001 15:37
54 lines
3015 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
Technical Details
Message-ID: <lZY47.157$XK6.25220@news.get2net.dk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!news.get2net.dk!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd8a0,a6924d2d1ce1b255
X-Google-Attributes: gidfd8a0,public
X-Google-Thread: 107481,c1f4cf16e2584b88,start
X-Google-Attributes: gid107481,public
X-Google-Thread: fa4f9,c1f4cf16e2584b88,start
X-Google-Attributes: gidfa4f9,public
X-Google-Thread: 1031eb,c1f4cf16e2584b88,start
X-Google-Attributes: gid1031eb,public
X-Google-Thread: 107d46,c1f4cf16e2584b88,start
X-Google-Attributes: gid107d46,public
X-Google-Thread: 11387c,c1f4cf16e2584b88,start
X-Google-Attributes: gid11387c,public
X-Google-Thread: 109779,a6924d2d1ce1b255
X-Google-Attributes: gid109779,public
X-Google-Thread: 1143a7,c1f4cf16e2584b88,start
X-Google-Attributes: gid1143a7,public
X-Google-ArrivalTime: 2001-07-17 08:38:05 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!news.get2net.dk!not-for-mail
Newsgroups: comp.databases.oracle.server,comp.databases.pick,comp.lang.basic.visual.database,comp.lang.java.databases,dk.edb.database.ms-access,it.comp.software.database,mailing.database.myodbc,mailing.database.mysql,microsoft.public.vb.database,microsoft.public.vb.database.ado
Subject: SQL-calls to 2 databases
From: psh@nst.com (Peder)
Organization: NST
User-Agent: Xnews/2.11.08
Followup-To: poster
Lines: 54
Message-ID: <lZY47.157$XK6.25220@news.get2net.dk>
Date: Tue, 17 Jul 2001 15:37:53 GMT
NNTP-Posting-Host: 129.142.144.252
X-Complaints-To: abuse@uni2.dk
X-Trace: news.get2net.dk 995384273 129.142.144.252 (Tue, 17 Jul 2001 17:37:53 MET DST)
NNTP-Posting-Date: Tue, 17 Jul 2001 17:37:53 MET DST