假设我有一个有效的查询,例如:
ScanRequest scanRequest = new ScanRequest()
.withTableName("myTable")
.withFilterExpression("attr1 = :val1 and attr2 = :val2")
.withExpressionAttributeValues(vm) //contains values for :val1 and :val2
.withLimit(PAGE_SIZE)
.withConsistentRead(READ_TYPE);
Run Code Online (Sandbox Code Playgroud)
现在我想扩展这个扫描.假设我的表还有一个attr3属性,其格式如下:
"attr3": {
"S": "AAA BBB CCC DDD"
}
Run Code Online (Sandbox Code Playgroud)
如何过滤attr3包含AAA的元素?还是AAA和BBB?
我正在创建一个postgreSQL表,它有一个引用自己的外键,所以它是一个类似于树的结构:
CREATE TABLE Person(
ID serial PRIMARY KEY,
Description text,
Name varchar(5),
ParentID serial,
FOREIGN KEY (ParentID) REFERENCES Person(ID)
);
Run Code Online (Sandbox Code Playgroud)
问题是ParentID自动设置为NOT NULL,因此该树中没有root.我如何让它可以为空?
我有一个数组,其中包含最多20个字符的字符串:
subtype c_string is string(1..20);
type string_array is array (natural range 1..100) of c_string;
Run Code Online (Sandbox Code Playgroud)
当我尝试将字符串分配给string_array的位置时,如果字符串不是20个字符长,则会出现以下错误:
提出CONSTRAINT_ERROR :( ...)长度检查失败
这是导致问题的代码行:
str_a: string_array;
(....)
str_a(n) := "stringToAssign" --Causes error
Run Code Online (Sandbox Code Playgroud)
避免这种情况的最佳方法是什么?
ada ×1
contains ×1
filter ×1
foreign-keys ×1
java ×1
key ×1
nullable ×1
postgresql ×1
string ×1