Use the CONCAT function to concatenate together two strings or fields using the syntax CONCAT(expression1, expression2). Though concatenation can also be performed using the || (double pipe) shortcut notation, errors are thrown if DB2 is not configured to allow it.Continue Reading
Open an SQL command line. In the command line type CONCAT. Follow it immediately with an open parenthesis.
Input the first expression. This can be either a string or a field from a table in the database. Follow the first expression with a comma.
After the comma, supply the second expression. As with the first expression, this can be either a string or a field from a table in the database. Follow the second expression with a closed parenthesis.
Hit the Entry key to execute the command. If both expressions are strings, as with "CONCAT('Hello', 'World')", the output of the command is a single string concatenation of the two, "HelloWorld." If both expressions are fields, as with "SELECT CONCAT(City, State) FROM Locations", the output is a set with all the entries in the first column joined with all the entries in the second column. If one expression is a string and the other a field, as with "SELECT CONCAT(City, 'NY') FROM NYCities", the output is a set with the string expression either prepended or appended to each entry in the given column.
The "md" command takes only the directory name as an argument, so its syntax is "md" followed by the directory you want to create. You can input a drive letter to create a directory anywhere or omit the drive letter to create a directory within the working directory.Full Answer >
The eighth edition of SQL for Dummies by Allen G. Taylor is available at Barnes & Noble and Amazon.com. Barnes & Noble sells the paperback version and the electronic version for the Nook e-reader. This book is eligible for the company's store pickup and free shipping services.Full Answer >