Establish a Data Dictionary

Establish a Data Dictionary

If your SQL looks like this, you need to ask yourself how much code you’d have to inspect and revise if you decided to change a database field or table name, as frequently happens during development:

 SQLString = "SELECT [first name], [last name], " & _	"[line preferences]" & _	" FROM [imaging users] WHERE [user code] = " & _	"'" & Trim(UCase(UserIDText.Text)) & "'"ODBCstatus = SQLExecDirect(ODBChandle1, SQLString, _	Len(SQLString))

What happens if SQL command conventions (field name delimiters) change? Because a compile doesn’t reveal such name misspellings or convention flaws, code in obscure procedures can be in production before defects are detected.

Our group established a table and field dictionary in a module used for a recent large project. This helped us ensure that we correctly pasted table and field names into all SQL commands. It also provided a repository that simplified maintenance.

As database resource names changed or new name-delimiting conventions were required, we revised the dictionary before recompiling. We also used the dictionary to convey descriptive information about tables and fields to developers. Our dictionary looks like this:

 'tables:Public Const tblUsers As String = "[imaging users]"'data fields:Public Const fldFirstName As String = "[first name]"	'16 charactersPublic Const fldLastName As String = "[last name]"	'16 charactersPublic Const fldLinePreferences As String = _	"[line preferences]"	'20 charactersPublic Const fldUserCode As String = "[user code]"	'10 characters

Our SQL looks like this:

 SQLString = "SELECT " & fldFirstName & _	", " & fldLastName & _	", " & fldLinePreferences & _	" FROM " & tblUsers & _	" WHERE " & fldUserCode & " = " & _	"'" & Trim(UCase(UserIDText.Text)) & "'"ODBCstatus = SQLExecDirect(ODBChandle1, SQLString, _	Len(SQLString))

Programmers don’t have to know the actual names of database components. They always use the constants that refer to the database components. A clean compile ensures you’ll use correct names and name-delimiting conventions in your SQL statements.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes