1,463 questions
0
votes
1
answer
74
views
Varying SQL query results [duplicate]
I have a table valued function called "elara_customer_byname". When I execute SELECT * FROM elara_customer_byname('%Kar%') I get 2 rows, which is incorrect. If I copy the SQL from the ...
0
votes
1
answer
37
views
Round a varchar2 column with a value of 00:00:00:00.000000
The data occasionally returns days:hours:minutes:seconds.0000 but is usually hours:minutes:seconds.0000 and the field in the table is a varchar2
Examples
01:04:23:14.679012 and
00:06:35:35.453899
I ...
0
votes
1
answer
194
views
Converting VARCHAR 'MMM-dd-yyyy' to DATE 'yyyymmdd' in SQL
Need help with conversion of a varchar value of 'MMM-dd-yyyy' to a DATE datatype in SSMS.
For example: from 'JAN-01-2025' to '20250101'.
I tried:
SELECT CONVERT(DATE, 'JAN-01-2025', 112)
However, it ...
-2
votes
3
answers
96
views
How to decide the maximal characters count for VARCHAR-like type columns in databases if specified value is actual only for one-byte characters?
In contrast to CHAR, VARCHAR values are stored as a 1-byte or 2-byte
length prefix plus data. The length prefix indicates the number of
bytes in the value. A column uses one length byte if values ...
0
votes
1
answer
347
views
Pivot on multiple columns in snowflake
I have following table in snowflake table
ID | NAME | QTY | LAYER
5026767 AB 25 1
5026767 XY 25 3
5026767 QE 50 2
5027016 TI 100 1
5027038 PP 30 1
5027038 CC ...
0
votes
0
answers
81
views
XML path into temp table creates a nvarchar column, issues when merging it varchar column
I using SQL Server 2012 and need to use FOR XML PATH to get a comma-separated string for like projects. The query runs and works but when I try to alter #T2, I get an error
String or binary data ...
1
vote
1
answer
223
views
Access token from Azure App has 6k+ chars & unable to save encrypted in SQL Server due to length restriction [closed]
To authenticate mail server from an application we use OAuth authentication. Application uses Java mail API for SMTP mail communication. We create an app in Azure and use its client ID and client ...
0
votes
1
answer
255
views
Redshift STL_LOAD_ERRORS col_length (256) different than DDL (12000)
I have a table called 'sales' which has a column called 'reason'. I am trying to load data into the column.
The data is;
"They found an issue with the software causing one of the chips an
issue ...
-1
votes
1
answer
531
views
TYPE CONVERSION: How do you convert a string to a decimal?
I'm trying to sum a column of varchar data, however the values all have commas and decimal points in them. It appears that the query cannot convert a string to a decimal. Help!
I have tried the below ...
0
votes
0
answers
81
views
SSIS data conversion loses extended ASCII
I'm reading from a data source that returns unicode strings, and the output goes into a data conversion transform where I output a "string [DT_STR]" from it as my database is using varchar ...
0
votes
2
answers
830
views
How to alter column to VARCHAR type with length L where L is based on the column aggregation like MAX(LENGTH(column)), PostgreSQL DB?
I am trying to alter column named names type from text to VARCHAR with length L. Where L is the maximum length of the names. I am trying with inner/sub-query as follows:
Is this even possible? Any ...
0
votes
0
answers
499
views
run-time error '-2147217913 (80040e07)' in Excel VBScript app affects different users differently
This triggers when the VBScript (in an excel based app) attempts to complete a userform and insert data into a table in a SQL database.
This affects only one user, it works fine for everyone else.
The ...
0
votes
1
answer
167
views
Azure Synapses, CSV, Convert VARCHAR to DATE, A few rows worked and others failed
Please help me to convert a column from VARCHAR to DATE of a csv file. I am baffled by the result that a few rows failed, while they looked normal when selected in their VARCHAR form.
I think this is ...
-1
votes
1
answer
98
views
How to convert varchar yyyy-mm to date
I have a column of data in the format of yyyy-mm that is VARCHAR(7). Using CONVERT doesn't work and I'm guessing it's because it needs a day in the string (yyyy-mm-dd), but I don't know how to add ...
0
votes
3
answers
2k
views
Use a variable containing a string of dates in an update statement in SQL
I am wanting to have a script which updates a table of days, setting the bankHoliday flag to true if it exists in a given list.
This list is something a user would update every year or two:
DECLARE @...
-2
votes
1
answer
5k
views
SQL query: how to convert data to numbers only when it does not contains letters
While extracting ERP products' references from SQL server, it is extracted as text.
These references sometimes contains only numbers, and sometimes it contains numbers + the letters CN.
I would like ...
0
votes
1
answer
22
views
MySQL no numbers varchar sorting not working
My attendee_lastname column definition:
My sql:
SELECT attendee_lastname FROM oc_attendee ORDER BY attendee_lastname ASC
My Result:
I would expect lastname Abraham to be first?
Any ideas?
0
votes
1
answer
620
views
Redshift Varchar Maximum limit reached
I have a long field in a .csv file 'field_x' and I have set the column size in the table DDL to VARCHAR(65535). When I try and run the COPY command to copy from the .csv file into the table, I receive ...
0
votes
1
answer
70
views
Re-split varchar column values in MySQL based on chunk size
I have this table where long strings are saved by splitting in the VALUE column and grouped by GROUPING_ID:
CREATE TABLE input_table
(
CHUNK_ID BIGINT NOT NULL
PRIMARY KEY,
...
1
vote
1
answer
83
views
like '%M' not working for character datatype PostgreSQL
like '%' works as expected for varchar datatype and not works for char datatype in PostgreSQL.
Created a table as below in PostgreSQL:
create table movie(movie_name varchar(20), director char(20));
[...
-4
votes
1
answer
132
views
Convert varchar "18-MAR-13" to Date in SQL Server
Varchar value "18-MAR-13" needs to be smartly converted to date as "18-03-2013" in DD-MM-YYYY format.
None of CAST, TRY_CAST, CONVERT, TRY_CONVERT worked.
I have tried with CONCAT, ...
0
votes
0
answers
28
views
MySQL Treating Varchar in SP as Hexadecimal
I have a stored procedure with the following inputs:
CREATE PROCEDURE AssignValuePosition
(
IN accountId INT,
IN valueType VARCHAR(128),
IN value VARCHAR(2000)
)
If I call the SP like so ...
0
votes
1
answer
295
views
Storing formatted text in Room Database
I downloaded a library. It is a Rich Text Editor Library. But when I replaced it with my old EditText, I couldn't access the text-related properties of my EditText. Like doAfterTextChanged, myEditText....
0
votes
2
answers
384
views
MySQL inconsistently requires quote marks around varchar inputs
In my "merchants" table, column AXPID is of integer data type, Vendor is varchar(255) and StoreNum is varchar(20).
at the mysql command line, I entered
INSERT INTO merchants (AXPID, Vendor, ...
1
vote
1
answer
164
views
How to update a MYSQL table column from Varchar data type to a time
I have a table in an MYSQL database and one of the columns (Incident_Time) has values such as 03:15 A and 12:30 P stored as varchar data type. However, I would like to change the data type from ...