In this tutorial you will learn the differences between a fixed-size and dynamic array, how to properly declare each one, how to access them, how to loop through them, how to erase them, and a few other things.
This tutorial applies to all versions of Visual Basic, however, versions before Visual Basic 6.0 do not include the split and join function.
So I will start with one of the most common types of data: strings.
Very few database tables and programs do , is a sequence of selected symbols from a particular set of characters.
You can read and answer the quiz here, and then check your answers in the next issue.
If, however, you take the quiz at PL/SQL Challenge, you will be entered into a raffle to win your choice of an e-book from O’Reilly Media (oreilly.com). As you might expect, there is an awful lot to learn about datatypes, and not all of that knowledge can fit into a single article.
I’ve presented a few possible solutions here, no doubt there are more.
Moving on to problem, I'll create a table which can be used to demonstrate this (for the purposes of simplicity I’ve removed most of the columns).
I won’t explain this further here, however there is an excellent article about this subject on MSDN titled 'Recursive Queries Using Common Table Expressions' The first instinct when confronted with a problem which involves converting rows to columns may be to use PIVOT, and indeed the following code uses the PIVOT operator.
Here is the table creation script : The requirement is to create a query that will concatenate the values in the ‘Txt’ column into a comma separated list.
The query needs to return one row and one column so that the results pane in SQL Server Management Studio looks like this : SQL Server 2005 opened up the possibility of using recursion within a SQL statement.
I recently had to look at a problem that required converting the column values from a set of rows into a single comma separated string.
On the face of it this is quite straightforward, but as with many things SQL Server there is more than one way to solve the problem.