oracle中.pls和.sql文件之间的实际区别是什么。两者对不同类型的语句有什么限制?
我得到了一个 unix(korn 脚本)项目,它在不同的地方同时使用 .sql 和 .pls 文件。试图弄清楚应该在哪里使用哪个。
我必须使用 ksh88 提取子字符串。(顺便说一句,找到 ksh 版本的简单方法$KSH_VERSION对我不起作用。我不得不使用
[ "`echo "\c" | grep c`" ] && echo ksh93 || echo ksh88
Run Code Online (Sandbox Code Playgroud)
我尝试使用命令echo ${stringvariable : 2: 2}但它说bad substitution。我是 Unix 世界的新手。这是我为得到结果所做的:
我已经使用 PUTTY 登录到 Unix 并输入了上面的命令。我也先尝试了 ksh 命令,然后是我的命令,但仍然没有成功。有什么我做错了吗?
另外,如果我想要从位置 2 开始直到结束的子字符串怎么做?
任何人都可以解释以下行的输出:
sprintf(tempStr,"%s%2s%s",year_str,month_str,day_str);
count=sscanf(tempStr,"%ld%s",&tempout,other);
Run Code Online (Sandbox Code Playgroud)
它使用日,月和年值创建数字日期.
但是,它如何将数值转换为长整数?
对于例如:你能告诉我,如果年,月和日是2016,02和08,那么这将是输出值tempout.
这里是输入的方式:
char date_str[20];
char day_str[2];
char month_str[2];
char year_str[2];
time_t now;
struct tm* current_time;
/* get current time */
now = time(0);
/* convert time to tm structure */
current_time = localtime(&now);
/* format day string */
sprintf(day_str,"%02d",current_time->tm_mday);
/* format month string */
sprintf(month_str,"%02d",current_time->tm_mon + 1);
/* format year string */
sprintf(year_str,"%d",current_time->tm_year);
/* assemble date string …Run Code Online (Sandbox Code Playgroud)