Re: Select statements syntax: The Answer
Try this on for size. select node_name, cast(platform_name as char(16)) as "OS/Name ", cast(client_os_level as char(10)) as "OS/Level", cast (client_version as char(1)) || '.' || cast(client_release as char(1)) || '.' || cast (client_level as char(1)) || '.' || trim(cast(client_sublevel as char(2))) as "Level" from nodes order by 2,4,1 Paul D. Seay, Jr. Technical Specialist Naptheon Inc. 757-688-8180 -Original Message- From: Jolliff, Dale [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 1:13 PM To: [EMAIL PROTECTED] Subject: Select statements syntax I need to create a select statement that concatenates numeric fields as text -- I need to create a single text field from the four numeric fields in the NODES table into a single text field. Once I get the fields CAST as CHAR type, how do I concatenate them? I tried SUBSTR but it pukes on too many arguments. This works: select substr(cast(client_version as char(1)),1,1) from nodes This doesn't: select substr(cast(client_version as char(1)),cast(client_release as char(1)),1,1) from nodes String concatenation is a basic function, I know it's there, I just can't remember the function name.
Re: Select statements syntax
Thanks to you all, perfect answer! -Original Message- From: Cook, Dwight E [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 12:52 PM To: [EMAIL PROTECTED] Subject: Re: Select statements syntax Way to go Paul ! example run against the occupancy table... tsm: TSMSRV01>select cast((physical_mb) as varchar(10)) || cast((logical_mb) as varchar(10)) as "My Concat Field" from adsm.occupancy My Concat Field -- 2521.282505.62 294.10293.42 0.030.03 0.000.00 6.146.12 0.240.24 294.77290.99 <... and on ...> Dwight -Original Message- From: Paul van Dongen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 12:33 PM To: [EMAIL PROTECTED] Subject: RES: Select statements syntax Try something like this: Select cast(client_version as char(1)) || cast(client_level as char(1)) from nodes -- Paul Gondim van Dongen Engenheiro de Sistemas MCSE Tivoli Certified Consultant - Storage Manager VANguard - Value Added Network guardians http://www.vanguard-it.com.br Fone: 55 81 3225-0353 -Mensagem original- De: Jolliff, Dale [mailto:[EMAIL PROTECTED]] Enviada em: Wednesday, December 18, 2002 15:13 Para: [EMAIL PROTECTED] Assunto: Select statements syntax I need to create a select statement that concatenates numeric fields as text -- I need to create a single text field from the four numeric fields in the NODES table into a single text field. Once I get the fields CAST as CHAR type, how do I concatenate them? I tried SUBSTR but it pukes on too many arguments. This works: select substr(cast(client_version as char(1)),1,1) from nodes This doesn't: select substr(cast(client_version as char(1)),cast(client_release as char(1)),1,1) from nodes String concatenation is a basic function, I know it's there, I just can't remember the function name.
Re: Select statements syntax
Way to go Paul ! example run against the occupancy table... tsm: TSMSRV01>select cast((physical_mb) as varchar(10)) || cast((logical_mb) as varchar(10)) as "My Concat Field" from adsm.occupancy My Concat Field -- 2521.282505.62 294.10293.42 0.030.03 0.000.00 6.146.12 0.240.24 294.77290.99 <... and on ...> Dwight -Original Message- From: Paul van Dongen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 12:33 PM To: [EMAIL PROTECTED] Subject: RES: Select statements syntax Try something like this: Select cast(client_version as char(1)) || cast(client_level as char(1)) from nodes -- Paul Gondim van Dongen Engenheiro de Sistemas MCSE Tivoli Certified Consultant - Storage Manager VANguard - Value Added Network guardians http://www.vanguard-it.com.br Fone: 55 81 3225-0353 -Mensagem original- De: Jolliff, Dale [mailto:[EMAIL PROTECTED]] Enviada em: Wednesday, December 18, 2002 15:13 Para: [EMAIL PROTECTED] Assunto: Select statements syntax I need to create a select statement that concatenates numeric fields as text -- I need to create a single text field from the four numeric fields in the NODES table into a single text field. Once I get the fields CAST as CHAR type, how do I concatenate them? I tried SUBSTR but it pukes on too many arguments. This works: select substr(cast(client_version as char(1)),1,1) from nodes This doesn't: select substr(cast(client_version as char(1)),cast(client_release as char(1)),1,1) from nodes String concatenation is a basic function, I know it's there, I just can't remember the function name.
RES: Select statements syntax
Try something like this: Select cast(client_version as char(1)) || cast(client_level as char(1)) from nodes -- Paul Gondim van Dongen Engenheiro de Sistemas MCSE Tivoli Certified Consultant - Storage Manager VANguard - Value Added Network guardians http://www.vanguard-it.com.br Fone: 55 81 3225-0353 -Mensagem original- De: Jolliff, Dale [mailto:[EMAIL PROTECTED]] Enviada em: Wednesday, December 18, 2002 15:13 Para: [EMAIL PROTECTED] Assunto: Select statements syntax I need to create a select statement that concatenates numeric fields as text -- I need to create a single text field from the four numeric fields in the NODES table into a single text field. Once I get the fields CAST as CHAR type, how do I concatenate them? I tried SUBSTR but it pukes on too many arguments. This works: select substr(cast(client_version as char(1)),1,1) from nodes This doesn't: select substr(cast(client_version as char(1)),cast(client_release as char(1)),1,1) from nodes String concatenation is a basic function, I know it's there, I just can't remember the function name.
Select statements syntax
I need to create a select statement that concatenates numeric fields as text -- I need to create a single text field from the four numeric fields in the NODES table into a single text field. Once I get the fields CAST as CHAR type, how do I concatenate them? I tried SUBSTR but it pukes on too many arguments. This works: select substr(cast(client_version as char(1)),1,1) from nodes This doesn't: select substr(cast(client_version as char(1)),cast(client_release as char(1)),1,1) from nodes String concatenation is a basic function, I know it's there, I just can't remember the function name.