小编Rus*_*lan的帖子

从现在开始的1个星期8点

我想从现在的早上8点得到一个DateTime.

一周很容易:

DateTime.now + 1.week
Run Code Online (Sandbox Code Playgroud)

如何将结果日期设置为特定时间?

ruby ruby-on-rails

6
推荐指数
2
解决办法
1413
查看次数

我如何转到RPGLE中循环中的下一个元素?

假设您有以下代码:

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)

loops rpgle

2
推荐指数
1
解决办法
164
查看次数

如何检查CL中的变量是否为空?

我有这段代码。

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)

control-language ibm-midrange

1
推荐指数
1
解决办法
1550
查看次数

从 Postgres sql 文件恢复

我以这种方式创建了 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 字符是空值?

database postgresql pg-restore

0
推荐指数
1
解决办法
3419
查看次数