Download BOB 50 SQL

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Relational algebra wikipedia , lookup

DBase wikipedia , lookup

Tandem Computers wikipedia , lookup

Oracle Database wikipedia , lookup

Database wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Microsoft Access wikipedia , lookup

Team Foundation Server wikipedia , lookup

Ingres (database) wikipedia , lookup

Btrieve wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Null (SQL) wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Transcript
BOB 50 SQL :
Migrating from BDE platform
3/09/2009
Agenda
•
•
•
•
•
•
•
•
•
Advantage Database Server : philosophy
From BDE to BOB 50 SQL
Warning and cautions
BOB-link
BOB-script
BOB-dev
BOB-ole
Custom tools
Conclusion/summary & questions
2
Sybase Advantage Database Server : philosophy
•
Commercialized under « SQL » acronym rather than « ADS » or
« Advantage Database Server » because it’s better known
•
Advantages vs. other RDBMS concurrent solutions
–
–
–
–
–
–
•
Small memory footprint (suitable for servers but also for traditional workstations)
Very light administration work (parameters are adjusting themselves automatically)
Installation is simple, maintenance is almost inexistent
BOB.EXE process limited size
Rights management through Windows NTFS permissions
Developed by Sybase, company whose core business is RDBMS
Advantages for BOB 50 :
–
–
–
Advantage Database Server was already used with BOB Software for more than 150
licenses.
Technology is already mastered by Sage. However, we use version 9 today to benefit
from latest features.
More robust database capable of handling large files and giving end-users high
productivity features (filters, reporting, sort mechanisms,…)
3
Conversion from BDE installations  BOB 50 SQL
•
Only with the BOB Migration Kit, on a workstation/server with
BDE. Better if all BDE files are stored locally.
•
Soon in the Migration Kit (v2.1+):
– Conversion of Fista BDE data to SQL Fista version
•
To convert from BOB 50 BDE to BOB 50 SQL, change the path of
« BOB Software folder » to the one of your « BOB 50 BDE »
installation. BOB 50 BDE companies will appear in the left
column.
•
New BOB 50 SQL installations must work in « NetSetup » mode
(except for TS/Citrix). Sage won’t give support to other types of
installation in the next months.
4
Warnings and cautions
•
File and folder structure in BOB 50 company folders :
– No more prefix with the two letters in filenames
– Prefixes becom AC_ (accounting, global files), IV_ (invoicing), FA_ (Fixed
assets), FI_ (Fiscal) et BK_ (Bank)
– All operational files are in the same folder
– BAK sub-folder contains file backups after reorganization
•
« NULL » has its own signification :
– With the SQL version, NULL has its own existence at filter level
• E.g. : (TCURRENCY<>’BEF’) becomes (TCURRENCY <> ‘BEF’) OR
(TCURRENCY IS NULL)
•
Don’t use quotation marks in filter expressions. Always use
single quotes.
•
Use brackets around tables and fields names to be sure that the
SQL Engine does not interpret it as some SQL reserved words.
E.g. : SELECT [LICENCES].[DATE] FROM [LICENCES]
5
BOB-link
•
BOBLINK.EXE and BOBLINKADSADT.EXE files
•
BOBLINK.EXE uses TXT, DB and DBF files as input
– Warning : Please do not forget to install BDE
•
BOBLINKADSADT.EXE is used to import ADT files (Advantage
Database Format) only :
– BDE is not necessary
•
In the SQL version, the LINK folder was relocated to the LINK\xx
sub-directory where xx is the company id
– In the BOB.INI file, LINK=C:\B50ADSDEMO\LINK
6
BOB-script
•
Cautions :
– Change names and filepaths where they are hard-coded with the old
notation structure. Cases where you don’t use « BOBOpen ».
– Check the filter expressions (own existence of NULL and use of single
quotes)
•
Code optimization :
– Use TBOBQuery to execute a SQL statement : Select, Insert, Update,
Delete, Update or another on ADT tables.
– Avoid use of loops with « do while » and « next » and replace with WHERE
conditions in the queries.
– For other database types (SQL Server, Oracle…), ADO objects are
available
•
Execution optimization :
– Add indexes on your custom fields via « General configuration » (currently
with RUNMODE=BETA)
7
BOB-script
•
TBOBQuery :
Properties :
Sql:
RecordCount :
Bof :
Eof :
RowsAffected :
string
integer
boolean
boolean
integer
Query definition
Record count
At the beginning of the table
At the end of the table
Number of updated records
Methods :
procedure Open;
Open the query in the recordset
procedure Close;
Close the recordset
procedure ExecSql;
Executes the query
procedure First;
Go to First record
procedure Last;
Go to Last record
procedure Prior;
Go to Previous record
procedure Next;
Go to Next record
function GetFieldValue(AFieldName: string): variant;
8
BOB-script
•
Example 1 (Pascal) :
myquery := tbobquery.create;
myquery.sql := 'select * from AC_COMPAN';
myquery.open;
ShowMessage(inttostr(myquery.recordcount));
myquery.last;
showmessage(myquery.getfieldvalue('CID'));
myquery.free;
myquery := nil;
•
Example 2 (Pascal) :
myquery := tbobquery.create;
myquery.sql := 'update AC_COMPAN set CADDRESS2 = ''AAA'' where CLANG = ''F''';
myquery.execsql;
showmessage(inttostr(myquery.RowsAffected));
myquery.free;
Myquery := nil;
9
BOB-dev
•
•
No changes
Check names and filepaths that are hardcoded
–
•
Take care with DatabaseName in the BOBDataSet
Be careful with filter expressions
10
BOB-OLE
•Be careful with filter expressions
•Some BOB Excel functions are optimized for the SQL version
–
AccountBalance, CompanyAccountBalance, CostBalance
•Some BOB Excel functions could be slower with SQL Server, some other could be
faster
•Check names and filepaths that are hardcoded
–
Take care with DatabaseName in the BOBDataSet
In the next months : Excel BOB function that takes a SQL statement as a
parameter and returns a variant
11
Custom tools
•
•
•
•
DbViewer
BOB Admin – Sybase Management
Installation Diagnostic
Advantage Data Architect and others
– http://www.sage.be/tools/sybase.zip
•
Other tools (support not provided by Sage) :
–
–
–
–
–
Advantage
Advantage
Advantage
Advantage
Advantage
.NET Data Provider
OLE DB Provider
ODBC Driver
Crystal Reports Driver
PHP Driver
12
Conclusion and questions
•
•
•
•
•
Check filenames and filepaths
Use custom indexes on tables where it’s necessary
Be careful with NULL/ empty strings in filters and queries
Use SQL queries whenever it’s possible to improve performance
Test your custom queries with Advantage Database Architect
Advanced
• LOGSQL=YES in [OPTIONS]  LogSQL.htm (to disable as soon as possible)
• AUTOADSINI=NO in [OPTIONS] if you have issues with automatic
creation/update of ADS.INI
To come in BOB 50 SQL 2.1 :
BOB Business Views and BOB Business Reports
Your questions and comments
13