Comments (4)
Sorry, I was going back and forth with the guy the wrote the SQL in question and I think we were wrong about the problem. We tested with another couple queries that had similar casting but they didn't give the same issue. We are thinking the issue might be coming from something weird he is doing with the date variable that's being passed into the query. Unfortunately the query is 1500+ lines long so debugging it is a bit outside my scope.
I will get back to you if we get anywhere with it.
from tds.
Hi @CaldwellYSR ,
I tried to reproduce your problem, but in my example it seems to work.
I tried the following:
iex> Repo.query("CREATE TABLE varchar_test (top_pick_sentence varchar(499))")
{:ok, %Tds.Result{columns: nil, num_rows: 0, rows: nil}}
iex> Repo.query("INSERT INTO varchar_test VALUES ('some veeeeeeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrryyyyyyyyyyyyyyyyyyyyy long string')")
{:ok, %Tds.Result{columns: nil, num_rows: 1, rows: nil}}
iex> Repo.query("select cast(top_pick_sentence as nvarchar(max)) as top_pick_sentence from varchar_test", [])
{:ok,
%Tds.Result{
columns: ["top_pick_sentence"],
num_rows: 1,
rows: [
["some veeeeeeeeeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrryyyyyyyyyyyyyyyyyyyyy long string"]
]
}}
Could you try the example above in your environment and maybe enable debug output for the queries, which are problematic, so I can take a look at the raw SQL queries?
from tds.
@CaldwellYSR
Any chance you could supply me with some debug output for the problem?
from tds.
@moogle19 I guess I'm going to close this issue because it's clearly incorrect. The SQL guy has given me a new query that works even when casting to nvarchar so clearly the casting isn't the issue. He believes the issue was related to that query using a ton of unions but he doesn't know that for sure.
If we find out what broke it I will create another issue.
from tds.
Related Issues (20)
- Getting MatchError even when passing correct credential HOT 10
- Ecto.Adapters.SQL.query/4 does not set correct type for parameters. HOT 7
- Need help with output parameter - SQL Server 2016 HOT 2
- Federated Auth HOT 3
- Implicit conversion from data type varbinary to date is not allowed HOT 18
- Current Status of this project? HOT 19
- Pull ntlm_auth to master HOT 3
- Support for Table Value Parameters in Tds adapter HOT 3
- TLS connection error with OTP 25 HOT 5
- Image type support? HOT 9
- FunctionClauseError following a connection redirect HOT 3
- Azure Sql Database error NXDOMAIN HOT 1
- Bureaucracy HOT 2
- Geometry column type support HOT 8
- Connect to SQL server over TCP HOT 4
- Azure Redirect TCP connection closes every 2 minutes HOT 5
- Error connecting to local MSSQL database
- TDS and query prefixes to access several databases inside MSSQL HOT 1
- Ecto queries timeout when using the Ecto.Adapters.Tds adapter to query 10000 rows with columns of floating point numbers HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tds.