|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Is there a way to take an entire row from a table and convert it to an
output string? I want to use the string and append it to a text file. Thanks Wes |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
wesley@ispace.co.za wrote:
> Is there a way to take an entire row from a table and convert it to an > output string? I want to use the string and append it to a text file. You can use CONCAT() function to combine values from different columns. The result will be a single string: http://dev.mysql.com/doc/refman/5.0/...functions.html |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
While the concat function is great, if you ever want to move this to a
real database engine like oracle... you can/should the ANSI standard syntax. select field1||','||field2||','||field3.... from tablex where .... |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
onedbguru@firstdbasource.com wrote:
> While the concat function is great, if you ever want to move this to a > real database engine like oracle... you can/should the ANSI standard > syntax. > > select field1||','||field2||','||field3.... from tablex where .... It should be mentioned that one has to set the SQL_MODE of PIPES_AS_CONCAT or ANSI to enable this syntax. Using this syntax without either of those SQL_MODE values in effect is still a legal expression. The double-pipe works like logical OR when not running in ANSI mode. So the resulting value of the expression will be 1, which might be confusing. Regards, Bill K. |
|
![]() |
| Outils de la discussion | |
|
|