1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: db_AdabasD.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:41 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : Create Adabas DS & Table & fill in Test
38 '\***********************************************************************
41 printlog "------------------ db_AdabasD.inc ---------------------"
43 if gPlatform = "x86" then
44 printlog "No Adabas available under x86."
46 printlog "No Adabas available under OpenOffice.org."
49 ' **************************************************
50 ' databases specific settings for Adabas D 11.02
51 ' **************************************************
53 Dim sFileName as string
54 sFileName = gOfficePath + "user/work/TT_Adabas.odb"
56 Dim sTableName as string
57 sTableName = "tt_test_table" 'table name lenght restriction
59 dim sCatalog as string
60 sCatalog = " " ' empty for adabas
63 sSchema = "TESTTOOL" ' case sensitive !
65 dim sRelTable1 as string 'for relation test (tRelation1&2)
66 sRelTable1 = "tt_rel1"
68 dim sRelTable2 as string 'for relation test (tRelation1&2)
69 sRelTable2 = "tt_rel2"
71 dim sRelTable3 as string 'for relation test (tRelation2)
72 sRelTable3 = "tt_rel3"
74 Dim aFieldTypeContent(17,3) as string 'database specific data matrix
76 aFieldTypeContent(1,1)="tt_boolean" 'name of fieldtype
77 aFieldTypeContent(1,2)="boolean" 'number of fieldtype (listbox entry)
79 aFieldTypeContent(2,1)="tt_long_byte"
80 aFieldTypeContent(2,2)="long byte"
82 aFieldTypeContent(3,1)="tt_varchar_byte"
83 aFieldTypeContent(3,2)="varchar() byte"
85 aFieldTypeContent(4,1)="tt_char_byte"
86 aFieldTypeContent(4,2)="char() byte"
88 aFieldTypeContent(5,1)="tt_long" ' does not work #69846
89 aFieldTypeContent(5,2)="long"
91 aFieldTypeContent(6,1)="tt_char"
92 aFieldTypeContent(6,2)="char"
94 aFieldTypeContent(7,1)="tt_decimal" ' will probably work after #108512 is fixed
95 aFieldTypeContent(7,2)="decimal"
97 aFieldTypeContent(8,1)="tt_fixed" ' will probably work after #108512 is fixed
98 aFieldTypeContent(8,2)="fixed"
100 aFieldTypeContent(9,1)="tt_integer"
101 aFieldTypeContent(9,2)="integer"
103 aFieldTypeContent(10,1)="tt_smallint"
104 aFieldTypeContent(10,2)="smallint"
106 aFieldTypeContent(11,1)="tt_float"
107 aFieldTypeContent(11,2)="float"
109 aFieldTypeContent(12,1)="tt_real"
110 aFieldTypeContent(12,2)="real"
112 aFieldTypeContent(13,1)="tt_double_precision"
113 aFieldTypeContent(13,2)="double precision"
115 aFieldTypeContent(14,1)="tt_varchar"
116 aFieldTypeContent(14,2)="varchar"
118 aFieldTypeContent(15,1)="tt_date"
119 aFieldTypeContent(15,2)="date"
121 aFieldTypeContent(16,1)="tt_time"
122 aFieldTypeContent(16,2)="time"
124 aFieldTypeContent(17,1)="tt_timestamp"
125 aFieldTypeContent(17,2)="timestamp"
127 Dim aFieldContent(1,4) as string
128 aFieldContent(1,1)="<Space>"
129 aFieldContent(1,2)="1"
130 aFieldContent(1,3)="1"
131 aFieldContent(1,4)="1"
136 dim aDatabaseProperties(5) as string
137 aDatabaseProperties() = tools_dbtools_fgetAdabasDatabaseProperties()
139 ' if and only if no properties are defined in the environment file the test is stopped
140 if(aDatabaseProperties(1) = "no") then
141 qaerrorlog "No database properties from Adabas defiened. The Test is stopped here."
145 dbok = fCreateAdabasDatasource( sFileName, aDatabaseProperties(2), aDatabaseProperties(3), aDatabaseProperties(4))
148 call fOpenDatabase(sFileName,"testtool")
149 call fDeleteTable( sTableName )
150 call fCreateTable( aFieldTypeContent(), sTableName )
151 call fInsertIntoTable( aFieldContent(), sTableName )
154 call tRelation( sFileName, sRelTable1, sRelTable2 )
155 call tDoubleRelation( sFileName, aDatabaseProperties(5), sRelTable1, sRelTable2, sRelTable3 )
156 call db_Query(sFileName,"adabas",aDatabaseProperties(5))
159 warnlog "Data Source could not be created - beyond testcases stopped"