Hi There,
I'm new to HANA Studio Sql. I'm trying to trim a column and export results to excel.
I used Trim(' ', Col1) "Col1" in select.
I then Export Result
Open in excel using "From Text" open in the Data Tab. Choose ' delimited. But still see the trailing blanks.
I just want the trim result.
Thanks,
Meena
Request clarification before answering.
Hi @Meenakshi Jayachandran
This is an example of what you need to do:
To create a table:
create column table "KABIL_PRACTICE"."TEST_EXP"
(
"ID" integer,
"Name" Nvarchar(10)
);
To insert a value into a table:
insert into "KABIL_PRACTICE"."TEST_EXP" values (1,' kabil'); -- the Name column contains blank space in front of the name
insert into "KABIL_PRACTICE"."TEST_EXP" values (1,' Arasan');
insert into "KABIL_PRACTICE"."TEST_EXP" values (2,'kabilan')
Result:

Try this code:
select trim (leading ' ' from "Name") from "KABIL_PRACTICE"."TEST_EXP"; -- here Name is a Column name
Result:

and Export the result.
and from your excel open it by navigate Data -> From text to the source file of the saved results it's like to be shown as below:

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.