varchar


EnitityFramework is very slow to compare strings because create a nvarchar sqlparameter instead of varchar

99封情书 提交于 2020-01-21 17:48:31
问题 I have this sample query: context.BarcodeTipiDoc.AsQueryable().Where(d => d.Barcode.CompareTo(minBarcode) > 0); That query runs very slow because Entity Framework creates SqlParameter for "minBarcode" as nvarchar instead of varchar . I tried to set column mapping: [Column("Barcode", TypeName = "varchar(21)")] public string Barcode { get; set; } but nothing changed. There is a way to tell to Entity Framework the right type of the sqlparameter? This query is almost instantaneous: DECLARE @_

using varchar over varchar(n) with Postgresql

℡╲_俬逩灬. 提交于 2020-01-16 10:36:09
问题 I'm designing a database, since I'm not yet confortable with the data types I was wondering the following : If I don't care about the length of a vector of characters, is it appropriate to use varchar ? (even if the strings are expected to be quite short ?) Until now I've been using text (varchar) when I needed to store really long strings but reading the documentation and asking questions around I heard postgresql does not store the extra-bytes if the maximum-length is supplied and the

SQL prototype design: facing silent truncation of data using varchar(N) — any better alternatives? (Teradata)

蓝咒 提交于 2020-01-15 04:01:46
问题 Situation: varchar(20) seems to truncate silently in Teradata and not to expand or complain when encountering strings larger than 20 characters long... This is a bit of a surprise as I expected either automatic expansion of the column to fit larger strings, say 30 characters, OR for an error to be thrown if a larger string were encountered. Silent truncation seems to get me the worst of all worlds... Complication: For my application (prototype analytics design) I don't know in advance how

Mapping to varchar and nvarchar in hibernate

守給你的承諾、 提交于 2020-01-09 19:10:34
问题 If there are 2 columns in database, eg. code varchar(3) name nvarchar(50) How to tell hibernate to pass varchar for searching by code? In the hibernate mappings string is mapped to nvarchar and it produces queries like: Select code, name From table where code=N'AAA' (instead of code='AAA') This is very bad as it causes index scan instead of index seek operation (scanning all index nodes instead of directly going to requested one) As code is used in millions of rows as well as in several

alternative to listagg in Oracle?

徘徊边缘 提交于 2020-01-09 19:08:30
问题 listagg is a function introduced in Oracle 11.2! now this function is bugging us allot, we are migrating from MySQL to Oracle and we have this query: SELECT p_id, MAX(registered) AS registered, listagg(MESSAGE, ' ') within GROUP (ORDER BY registered) AS MESSAGE FROM umm_parent_id_remarks_v m GROUP BY m.p_id; is works fine in MySQL as far as we know what bugging us is under Oracle it returns VARCAR and not CLOB as we need! the text is huge and we do need it to be CLOB ! here is what I tried to

Mapping to varchar and nvarchar in hibernate

孤街醉人 提交于 2020-01-09 19:08:05
问题 If there are 2 columns in database, eg. code varchar(3) name nvarchar(50) How to tell hibernate to pass varchar for searching by code? In the hibernate mappings string is mapped to nvarchar and it produces queries like: Select code, name From table where code=N'AAA' (instead of code='AAA') This is very bad as it causes index scan instead of index seek operation (scanning all index nodes instead of directly going to requested one) As code is used in millions of rows as well as in several

Mapping to varchar and nvarchar in hibernate

二次信任 提交于 2020-01-09 19:06:10
问题 If there are 2 columns in database, eg. code varchar(3) name nvarchar(50) How to tell hibernate to pass varchar for searching by code? In the hibernate mappings string is mapped to nvarchar and it produces queries like: Select code, name From table where code=N'AAA' (instead of code='AAA') This is very bad as it causes index scan instead of index seek operation (scanning all index nodes instead of directly going to requested one) As code is used in millions of rows as well as in several

alternative to listagg in Oracle?

走远了吗. 提交于 2020-01-09 19:04:33
问题 listagg is a function introduced in Oracle 11.2! now this function is bugging us allot, we are migrating from MySQL to Oracle and we have this query: SELECT p_id, MAX(registered) AS registered, listagg(MESSAGE, ' ') within GROUP (ORDER BY registered) AS MESSAGE FROM umm_parent_id_remarks_v m GROUP BY m.p_id; is works fine in MySQL as far as we know what bugging us is under Oracle it returns VARCAR and not CLOB as we need! the text is huge and we do need it to be CLOB ! here is what I tried to

long varchar to string

微笑、不失礼 提交于 2020-01-06 15:02:45
问题 I am using a long varchar column to store log information. Now I want to retrieve it to a string, in C#, using a DataReader. However, there is an error: Request to retrieve BLOB column which had already been accessed. BLOB column may only be accessed once. 回答1: Maybe this url will help you: Retrieving ntext, text, or image Values Best regards 来源: https://stackoverflow.com/questions/18483262/long-varchar-to-string

Data type for an ID field (int or varchar)

左心房为你撑大大i 提交于 2020-01-05 01:33:35
问题 What is advisable data type of an ID field (such as state ID or web_form_id or employeeID)? Is it best to use an int data type of varchar (and why) ? 回答1: For an Id, which is going to be unique to each user, its recommended to go with int , and as this sounds more like an sql question, in the auto_increment mode. 来源: https://stackoverflow.com/questions/6554630/data-type-for-an-id-field-int-or-varchar

工具导航Map