NVARCHAR (MAX) in SQLite

I create a table in Sqlite, which contains a column with the maximum length:

create table [Log] ( 
Id int identity not null
constraint PK_Log_Id primary key,
Data nvarchar (max) null
)

But the following line was not accepted:

Data nvarchar (max) null

Why?

max is specific to SQL Server (Sybase I think). Just use text:

data text not null

Alternatively, you can use any string data type. SQLite does not enforce a length limit:

Note that numeric arguments in parentheses that following the type
name (ex: “VARCHAR(255)”) are ignored by SQLite – SQLite does not
impose any length restrictions ( other than the large global
SQLITE_MAX_LENGTH limit) on the length of strings, BLOBs or numeric
values.

(see here).

< /p>

I create a table in Sqlite, which contains a column with the maximum length:

create table [Log] (
Id int identity not null
constraint PK_Log_Id primary key,
Data nvarchar (max) null
)

But the following line was not accepted:

< /p>

Data nvarchar (max) null

Why?

max is specific to SQL Server (Sybase I think). Just use text:

< pre>data text not null

Alternatively, you can use any string data type. SQLite does not enforce length restrictions:

Note that numeric arguments in parentheses that following the type
name (ex: “VARCHAR(255)”) are ignored by SQLite – SQLite does not
impose any length restrictions (other than the large global
SQLITE_MAX_LENGTH limit) on the length of strings, BLOBs or numeric
values.

(see here).

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 896 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.