One of my parameter looks like this: I know that User has null value in last_sign_in_at. Database accept nulls for this column but I get an exception: SqlException: The parameterized query ‘(@id int,@name nvarchar(18),@username nvarchar(11),@state nvarch’ expects the parameter ‘@last_sign_in_at’, which was not supplied. Answer You should be using DBNull.Value: Casting to object here is just for operator ?? to
Tag: sql
SQL select single row number x only
For processing SQL data in VBA I want to use a loop (For…Next) that reads line by line from a SQL database. As records were deleted the ID column has gaps. The table looks for example like this: Having four lines I would like to run of course a “For each” would do good, too. Answer If you want 4
Mysql comma seperated to json-array
I have some fields in the database that are comma selerated, something like: a,b,c,d,e and I want to convert them into: I know how to do it in nodejs / any other language, but I need to do it directly on the mysql Possible? Thanks Answer The simplest approach probably is to use string functions only: Basically this turns a
find exact number in text field in sql
I am trying to query exact number in array inside text field in sql so for example can return which is not good because i would like to get the arrays that contain 1 Answer You could use JSON functions:
Oracle Procedure call too long string
Hello I have one procedure like my problem is that P_SICIL or P_EXISTS can be too long so all length can be more then 4000 characters. when I call procedure it gives below error ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 14103, maximum: 4000) if I dont use to_char for clobs then I
T-SQL: removing Time and Preceding characters from nvarchar column
I have a comments column in a SQL Server database table of type nvarchar and typically contains text along the lines of: I am trying to find a way in the select statement to remove the character pattern of ‘#:#:# AM/PM’ and everything preceding it leaving me with “Blah Blah…” In doing so I don’t want to remove legitimate uses
Creating Flutter Web Server that connects to an SQL server
I want to create a Flutter web server that has an SQL connection. Just like in PHP we can connect to the SQL server like this: // Connecting to DB $conn = new mysqli($servername, $username, $password, …
How to get just one result when using MAX and GROUP BY
I would love some help on this query: select * from STORAGE_MOVEMENT where object_id = 43500 and current_location != 6411 and object_class = ‘SAMPLE’ Here’s what I get: I’m trying to fetch only …
SQL query to get data without hours in timestamp column
I have written a code and sql query to get data from database: I get this dataframe: I want to write another query to get data only for 2019-05-29: but it brings me an error: How could i do that? How could i get rid of hours in timestamp column in my sql query? Desired result is: Answer toDate(timestamp) SELECT
Error in SSMS when running query from SQL On-Demand endpoint
I am attempting to pull in data from a CSV file that is stored in an Azure Blob container and when I try to query the file I get an error of File ‘https://.blob.core.windows.net/&…