13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Initial Programming Considerations<br />

2–32<br />

In a <strong>Data</strong><strong>Server</strong> application, you assign the Unknown value (?) to a column by using the<br />

question mark operator (?), which the <strong>Data</strong><strong>Server</strong> translates to the appropriate null-value<br />

representation. For example, the following procedure assigns the Unknown value (?) to the<br />

address2 field of the customer table:<br />

FIND FIRST customer.<br />

customer.address2 = ?.<br />

Zero-length character strings<br />

When you use the Unknown value (?) in a WHERE clause with the <strong>Data</strong><strong>Server</strong>, the Unknown<br />

value (?) satisfies only the equals (=) or not equal () operator. You can also use a zero-length<br />

character string in a WHERE clause. The Unknown value (?) and zero-length character string are<br />

not the same. The Unknown value (?) translates to a NULL, which is a special marker in a data<br />

source that supports NULLs used to represent missing in<strong>for</strong>mation. On the other hand,<br />

zero-length strings and blank columns contain actual values. Both of the following statements<br />

find the first customer record with a zero-length string in the address2 field. Notice the space<br />

between the quotation marks in the first statement:<br />

FIND FIRST customer WHERE customer.address2 EQ " ".<br />

FIND FIRST customer WHERE customer.address2 EQ "".<br />

Although “” and “ ” evaluate the same way in a WHERE clause, they have different results when<br />

you use them with the BEGINS function. For example, the following statement retrieves all<br />

customer names except those that have the Unknown value (?):<br />

FOR EACH customer WHERE customer.name BEGINS "":<br />

The following statement uses "" to retrieve only those names that begin with a space:<br />

FOR EACH customer WHERE customer.name BEGINS " ":

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!