我想从现在的早上8点得到一个DateTime.
一周很容易:
DateTime.now + 1.week
Run Code Online (Sandbox Code Playgroud)
如何将结果日期设置为特定时间?
假设您有以下代码:
FOR I = 1 to 10;
// some code here
ENDFOR;
Run Code Online (Sandbox Code Playgroud)
您将如何跳过元素?当前正在使用GOTO
作品,但我不喜欢该解决方案。例如:
FOR I = 1 to 10;
IF I = 4;
C GOTO NEXTONE
ENDIF;
// some code here
C NEXTONE TAG
ENDFOR;
Run Code Online (Sandbox Code Playgroud) 我有这段代码。
IF COND(%TRIM(&BLANK_VAR) *EQ '') THEN(DO)
CALL PGM(MY_PROGRAM) PARM(&BLANK_VAR)
ENDDO
Run Code Online (Sandbox Code Playgroud)
我想检查是否&BLANK_VAR
是空字符串。但是,由于错误消息,我的程序无法编译:
* CPD0126 30 Operand not valid or operator missing in COND.
Run Code Online (Sandbox Code Playgroud)
这是一个问题%TRIM
吗?我尝试使用%LEN
但它给了我声明的变量的长度,而不是里面的实际数据。
&BLANK_VAR
长度为 10 个字符。我是否必须这样做:
IF COND(&BLANK_VAR *EQ ' ')
Run Code Online (Sandbox Code Playgroud) 我以这种方式创建了 PostgresSQL 数据库的备份:
/usr/bin/pg_dump --no-owner --no-acl > dump.sql
当我尝试在另一台机器上恢复时:
psql db < dump.sql
它引发了许多错误: invalid command \N
当我尝试使用pg_restore
:
pg_restore dump.sql -d db
不同的错误: pg_restore: [archiver] input file appears to be a text format dump. Please use psql.
根据文档,这应该不是问题。
有什么方法可以告诉psql
\N 字符是空值?