csvquery | A handy SQL runner to work with CSV files | CSV Processing library
kandi X-RAY | csvquery Summary
kandi X-RAY | csvquery Summary
CSVQuery is a handy SQL runner to work with CSV files. You can use SQL to parse and filter CSV rows!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of csvquery
csvquery Key Features
csvquery Examples and Code Snippets
Community Discussions
Trending Discussions on csvquery
QUESTION
I've got a bug in a CFStoredProc that's causing a crash whenever I try to send a decimal value to the stored procedure. The procedure simply inserts the value into a decimal(4,2) column in a SQL table. If I hard code a decimal value as the value of the cfprocparam, the procedure works. However, if the value is read in from a file, the I always get the error "Error converting data type decimal to decimal", no matter what I do to ensure the number is formatted correctly. Can anyone see what I'm doing wrong here?
My code essentially does the following:
- Read a CSV file and convert it to a Query
- Loop through the query to read the CSV data into variables
- Send those variables to a stored procedure as cfprocparams
I have tried:
- Formatting the number using numberFormat() before sending it to the stored procedure
- Formatting the number using decimalFormat() before sending it to the stored procedure
- Formatting the number using a custom function that does the same thing elsewhere in our application
- Formatting the number using the aforementioned functions in the 'value' part of the cfprocparam
Code samples of what I've tried:
...ANSWER
Answered 2021-May-17 at 16:28It turns out that the value being passed to the stored procedure was too large for the data type of the column into which it was being inserted. Data type was Decimal(3,2) and the value I was passing had more then three digits.
The solution was to check the size of the number being passed to the stored procedure, and give the user an error if the value is too large.
Thanks to @Tomalak for the help!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install csvquery
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page