Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
5 subscribers
Views
2936 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Export SQL to Excel @sathya.srinivasan I have been trying to use the
hayleyw
over 10 years ago
Export SQL to Excel
@sathya.srinivasan I have been trying to use the Export SQL to Excel smart service but it is only returning values for a column that is a date field, it is not returning any of the varchar field values. Has the smart service been updated to process values other than Date and Integers?
Thanks
OriginalPostID-139929
OriginalPostID-139929
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Hi, can you provide me with details of the SQL that you are trying to execute? Appian tries to automatically recognize the data type and typecast the output for Excel sheet.
Couple of things to check. Are you running a Select on a table or a view? what is the description of the table (desc <table/view name>)
Can you also try executing an sql on a simple table (say, create one with 3 or 4 columns of different types such as int, date, varchar etc) and see if you are able to successfully able to export.
Lastly, I would also recommend you enable debugging to see if you get more info on the log about what's happening.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hayleyw
over 10 years ago
Hi Sathya
I stripped the SQL right down to just return 2 columns as below
="SELECT [AccountNumber], DateOpened FROM vw_CustomerInformation"
The SQL is executing on a view. The AccountNumber column is an nvarchar(20) and the dateOpened is a datetime.
The values for dateOpened returns but the AccountNumber remains blank.
Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
right, can you try providing an alias for AcountNumber and see if that populates the data?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hayleyw
over 10 years ago
Hi Sathya,
I have just managed to get this to work using CAST and this has worked (example below)
="SELECT CAST(AccountNumber AS varchar(20)), DateOpened FROM vw_CustomerInformation"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Thanks for updating. The plugin depends on the information the JDBC driver provides. I have seen the same issue where not able to get the correct type-cast fails to return values.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
hayleyw
over 10 years ago
Thanks for you help with this Sathya
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
siddharthg521
over 10 years ago
Hi hayleyw,
I had observed the similar issue with this service in the past wherein the varchar field sometimes doesn't populate in excel using this service.
As a workaround, I changed the type of that field from varchar to nvarchar, and then tried to run this service and it successfully populated my excel !
Hope it helps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel