Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread SQL problem ...memory working table
Mon, Mar 26 2007 3:54 PMPermanent Link

Allan Brocklehurst
I'm having a problem with the following

Hello.

Status:
Moving  data base to new server: WONDOWS 2003 Server
DBSrvr 4.04
All of the  SQL statements below  are generated within the application


DROP TABLE IF EXISTS "Memory\WorkingTable"  ;
 CREATE TABLE IF NOT EXISTS "Memory\WorkingTable"
 (
   "Health Card Number" VARCHAR(50),
   "ProcedureName" VARCHAR(50),
    "Accession Number" VARCHAR(50),
    "Isolate" VARCHAR(100),
    "District Group" VARCHAR(50),
    "Hospital" VARCHAR(50),
    "Client Medical Record number" VARCHAR(30),
    "Inpatient" BOOLEAN DEFAULT False,
    "Name" VARCHAR(50),
    "Date of Birth" DATE,
    "AGE" INTEGER,
    "Doctor Name" VARCHAR(50),
    "Source" VARCHAR(50),
    "Doctor Phone Number" VARCHAR(20),
    "Observed_Completed Date" DATE,
    "Observed_Completed Time" VARCHAR(10),
    "Amended_Preliminary" VARCHAR(150),
    "Sex" VARCHAR(10) DEFAULT 'FEMALE' CHARCASE UPPER,
    "DistrictNo" VARCHAR(10),
    "RecID" AUTOINC,
    "OID" GUID DEFAULT CURRENT_GUID,
    "Collected Date" DATE,
    "Disease" VARCHAR(60) CHARCASE UPPER,
    "Memo" MEMO CHARCASE UPPER,
 PRIMARY KEY ("OID") COMPRESS NONE
 DESCRIPTION 'STD Records'
 LOCALE CODE 0
 USER MAJOR VERSION 1
 );

  This statement works in dbsys and in the application

=====================================================================================



   INSERT INTO "\Memory\WorkingTable" ([Health Card
Number],[ProcedureName],[Accession Number], [Isolate],
   [District Group],[Hospital],[Client Medical Record
number],[Inpatient],[Name],
   [Date of Birth],[AGE],[Doctor Name],[Source],[Doctor Phone
Number],[Observed_Completed Date],
   [Observed_Completed
Time],[Amended_Preliminary],[Sex],[DistrictNo],[OID],[Collected Date],
   [Disease],[Memo])
   SELECT
   [Health Card Number],[ProcedureName],[Accession Number],[Isolate],
   [District Group],[Hospital],[Client Medical Record
number],[Inpatient],[Name],
   [Date of Birth],((CURRENT_DATE - [date of birth])/365.242190) AS
AGE,[Doctor Name],[Source],[Doctor Phone Number],[Observed_Completed
Date],
   [Observed_Completed
Time],[Amended_Preliminary],[Sex],[DistrictNo],[OID],[Collected Date] ,
  [DiseaseMemo].[Disease] ,[DiseaseMemo].[Memo]
   FROM "MIS0A"
   LEFT OUTER JOIN  DiseaseMemo ON  [DiseaseMemo].[Disease] =
[MIS0A].[Isolate]
 WHERE ([MIS0A].[Observed_Completed Date] BETWEEN '2007-03-19' AND
'2007-03-26')

JOINOPTIMIZECOSTS
UNION ALL

   SELECT
   [Health Card Number],[ProcedureName],[Accession Number],[Isolate],
   [District Group],[Hospital],[Client Medical Record
number],[Inpatient],[Name],
   [Date of Birth],((CURRENT_DATE - [date of birth])/365.242190)  AS
AGE,[Doctor Name],[Source],[Doctor Phone Number],[Observed_Completed
Date],
   [Observed_Completed
Time],[Amended_Preliminary],[Sex],[DistrictNo],[OID],[Collected Date] ,
   [DiseaseMemo].[Disease] ,[DiseaseMemo].[Memo]
   FROM "MIS02D"
   LEFT OUTER JOIN  DiseaseMemo ON  [DiseaseMemo].[Disease] =
[MIS02D].[Isolate]
 WHERE ([MIS02D].[Observed_Completed Date] BETWEEN '2007-03-19' AND
'2007-03-26')
JOINOPTIMIZECOSTS

This statement( below) ONLY works in dbsys.  when I run the application
it says that "\Memory\WorkingTable" does noit exist. any sugestions?

Allan
=========================================================================
Mon, Mar 26 2007 9:33 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< This statement( below) ONLY works in dbsys.  when I run the application
it says that "\Memory\WorkingTable" does noit exist. any sugestions? >>

Did you verify that the memory table is indeed being created okay before the
INSERT is executed ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 27 2007 9:49 AMPermanent Link

Allan Brocklehurst
Tim Young [Elevate Software] wrote:
> Allan,
>
> << This statement( below) ONLY works in dbsys.  when I run the application
> it says that "\Memory\WorkingTable" does noit exist. any sugestions? >>
>
> Did you verify that the memory table is indeed being created okay before the
> INSERT is executed ?
> Tim;
Hi and thanks for the reply.

Yes the table is being created The temporary file directory on
srvadmin.exe is c:\winnt\temp.  Are the memory tables created here?

Allan
Tue, Mar 27 2007 2:18 PMPermanent Link

Allan Brocklehurst
Allan Brocklehurst wrote:
> Tim Young [Elevate Software] wrote:
>> Allan,
>>
>> << This statement( below) ONLY works in dbsys.  when I run the
>> application it says that "\Memory\WorkingTable" does noit exist. any
>> sugestions? >>
>>
>> Did you verify that the memory table is indeed being created okay
>> before the INSERT is executed ?
>> Tim;
> Hi and thanks for the reply.
>
> Yes the table is being created The temporary file directory on
> srvadmin.exe is c:\winnt\temp.  Are the memory tables created here?
>
> Allan
Tim;
the problem was in the sessions remote address property. I had it only
recorded as a property value for the TDBISAMSession. It should have been
 a readable (from an ini file) value.  The good news it that when we do
a final flip of the servers, the old servers IP address will be new
servers IP address. so I don;t have to recompile and send this out to
everyone

Thanks for you time on this

Allan
Wed, Mar 28 2007 7:51 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< the problem was in the sessions remote address property. I had it only
recorded as a property value for the TDBISAMSession. It should have been  a
readable (from an ini file) value.  The good news it that when we do
a final flip of the servers, the old servers IP address will be new servers
IP address. so I don;t have to recompile and send this out to everyone >>

Well, things worked okay then. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image