Skip to main content

Questions tagged [string]

Filter by
Sorted by
Tagged with
0 votes
1 answer
278 views

What is the idiomatic way to truncate a string down to 100 byte-pairs?

nvarchar(100) holds 100 byte-pairs, as documented here. LEFT([Your String], 100) truncates your string down to 100 characters as documented here. These are not the same. Foolishly, I have used LEFT([...
J. Mini's user avatar
  • 1,286
1 vote
1 answer
2k views

When does Oracle still treat empty strings as NULL?

I was looking for the difference between VARCHAR and VARCHAR2 and learned, among other things, that Oracle’s VARCHAR2 treats empty strings as NULL, or the other way round. Also, apparently I should be ...
Manngo's user avatar
  • 3,207
0 votes
2 answers
367 views

How to convert getdate() stored as varchar to date

I have stored 'getdate()' as text in one of my column in a table. (It's a complicated scenario ,how I saved it) Now when I select the field what I am getting is getdate() instead of the date . How can ...
Viz Krishna's user avatar
1 vote
0 answers
78 views

How does mysql_real_escape_string() work?

I have to send some string (in C) as a query to MySQL, so i used mysql_real_escape_string() to escape some characters like \0 or \n: #include <mysql/mysql.h> int loginQuery(char *Nickname, char *...
SempriGno's user avatar
2 votes
2 answers
2k views

How to use replace text function in a column using another table as a "lookup table" reference?

Here's some examples to show what I'm after. The source table (the one to have its string values changed): | string | |-----------------------| | abc${hello}123 | | def${yolo}321 ...
Tiago Stapenhorst's user avatar
1 vote
1 answer
1k views

How to prevent CONCAT function adding space in Postgresql?

Postgresql-11 select tick_time, nano_secs, concat( to_char(tick_time, 'MMDD HH24:MI:SS.US'), to_char(nano_secs, '000') ) from ticks order by tick_time, nano_secs limit 100; I want to ...
Leon's user avatar
  • 413
0 votes
1 answer
2k views

Cannot Insert it into in my table for Special characters when ANSI_WARNINGS is Off even with nvarchar

I want to insert a data row into my table as name: DSKWOR00 , but I get this error : String or binary data would be truncated. so I turned ANSI_WARNINGS OFF and it inserted the row but the result ...
مجتبی حکیمیان's user avatar
0 votes
1 answer
834 views

Covert from literal HEX value to INT MariaDB

I have a situation where i need to get the integer value from a literal hex. Example: "ff" equals 255 in decimal, but if i use the HEX("ff") function it returns 6666. Is it ...
Adelina Andreea trandafir's user avatar
5 votes
1 answer
234 views

Match .csv values as INTs. If one value from a group in the .csv matches one in another group, then merge strings

Here we have two sets of numbers. The problem is that I can't figure out how to get from the input to the output of numbers (DDL and DML below and also in the fiddle here). current_data 1,2,3 1,4 1,5,...
user3050153's user avatar
0 votes
2 answers
984 views

Indexing on a fixed-length string (10 characters - phone numbers) for a large number of entries (performance)?

I understand that a lot of similar questions have already been asked but I could not find a definitive answer for my question. Briefly, I have to authenticate users using a REST API, with their phone ...
gkm's user avatar
  • 9
0 votes
1 answer
2k views

Calculating Average Value of JSONB array in Postgres

I have a column called "value" in my "answers" table. | value | |---------| | [1,2] | | [1] | | [1,2,3] | The type of "value" is "jsonb". I want to get ...
user avatar
7 votes
1 answer
2k views

text column compares equal to where clause but does not select matching row

We are having trouble when querying a table in our production database. One text column will compare equal to a string we filter on in the where clause, but postgres will not select the row. (We are ...
Nate's user avatar
  • 73
0 votes
1 answer
569 views

What exactly is the datatype input into a DATETIME value in MySQL

I am trying to get data from a PLC directly into a MySQL 8.0 database (using MySQL Workbench). I need to know what data type the input value is for a column set to DATETIME so I can send in the right ...
E.Aigle's user avatar
  • 105
1 vote
2 answers
399 views

Replace specific part of a string

I've got a table with multiple columns, APGRPID, VIRTKEY, LFDNR and PARAMETERLIST. I want to change a part of some strings in the PARAMETERLIST column. In the PARAMETERLIST I want to replace the "...
S_Koenig's user avatar
0 votes
2 answers
766 views

convert date in string format to date datatype sql [duplicate]

I have values in a column named Date as a nvarachar data type in the form of mmddyy and want to convert the values to a date datatype in the form of yyyy-mm-dd. What sql colde can I use to convert the ...
HappyCoder123's user avatar

15 30 50 per page
1
2 3 4 5
7