小编xGe*_*Gen的帖子

oracle中.pls和.sql文件的实际区别

oracle中.pls和.sql文件之间的实际区别是什么。两者对不同类型的语句有什么限制?

我得到了一个 unix(korn 脚本)项目,它在不同的地方同时使用 .sql 和 .pls 文件。试图弄清楚应该在哪里使用哪个。

unix oracle ksh sqlplus

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

在 korn shell 中获取字符串的子字符串

我必须使用 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 开始直到结束的子字符串怎么做?

unix ksh

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

sscanf转换为长整数

任何人都可以解释以下行的输出:

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,0208,那么这将是输出值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)

c

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

标签 统计

ksh ×2

unix ×2

c ×1

oracle ×1

sqlplus ×1