dbupgrade

beasscript-logo-small

object=ue_installation=dbupgrade=#<variable>

object=ue_installation=dbupgrade=<filename>

 

if you use older version than beas8.8-0-0-76, use

object=ue_installation=dbpruef=#<variable>

 

Add new tables, columns or indexes

or make correct length or types

 

Normally, Beas reads the file db.ini and executes this table-definition-File

 

Keywords

table=<tablename>

Creates a new table. After this command you need the Primary and the columns

primary=<table>=<column>,<column>

set or change the Primary-key

column=<table>=<columnname=<typ>

Create a new column for the Table

udf=<table>=<column>=<Description>=<typ>=<typ2>=<length>

Create a SAP-UDF-Column

Typ / Typ2

dec,float,decimal,real / rate, sum. price, quantity, percent

int, numeric, num / ..

date, datetime / time, ...

memory, text / ..

alpha, char, string, varchar / address, phone / length

 

delcolumn=<table>=<column>

Delete the Column

First you must set "delcolumn" to yes

delcolumn=yes

delcolumn=mytable=mycolumn

 

droptable=<table>=<true/false/empty>=<column>

Delete the Table, if column exist in the table or column is not existing

false = delete table, if column not existing

true = delete the table, if column is existing

empty = delete table always

 

droptable=mytable   delete table always

droptable=mytable=true=mycol  delete table if column mycol does not exist

 

default=table=column=value

sets a default value without constraint if value for the table/column is null

constraint=<table>=<column>=<constraintname>=<constraint>

creates or alter a constraint

delconstraint=<table>=<constraintname>

Deletes a constraint

script=<script>

Executes this BeasScript

sql=<sqlscommand>

Executes this SQL-Command



 

Example: Create new Table

#define dbcheck

table=beas_oitm_material

primary=beas_oitm_material=baseitemcode,itemcode

column=beas_oitm_material=baseitemcode=varchar(30) not null

column=beas_oitm_material=itemcode=varchar(30) not null

column=beas_oitm_material=quantity=decimal(19,6)

#end

object=ue_installation=dbupgrade=#<dbcheck>