如何给date型数据赋空值

iriscj 2007-12-19 02:45:09
如题
...全文
1970 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyuchang 2007-12-19
  • 打赏
  • 举报
回复
setnull(变量)
eviler 2007-12-19
  • 打赏
  • 举报
回复 1
定义一个date 类型变量 date dt
将其赋空 setnull(dt)

然后 把dt付给你要的变量
-狙击手- 2007-12-19
  • 打赏
  • 举报
回复
setnull()
dawugui 2007-12-19
  • 打赏
  • 举报
回复
14、SetNull()
功 能:将指定变量的值设置为NULL。这里的变量可以是除数组、结构、自动实例化对象之外的任何数据类型。
语 法:SetNull ( anyvariable )
参 数:anyvariable:要将其值设置为NULL的变量。
返回值:Integer。函数执行成功时返回1,发生错误时返回-1。如果任何参数的值为NULL,SetNull()函数返回NULL。
用 法:PowerBuilder应用程序在说明变量时,并不自动地将其初值设置为NULL,而是根据类型的不同而设置不同的初值,比如,数值类型的变量自动初始化为0,字符串型变量自动初始化为空字符串("")。因此,如果需要将某个变量的值设置为NULL,就需要使用SetNull()函数来完成任务了。一般来说,NULL值往往应用在数据库值未确定的列上。
示 例:This statement sets the variable Salary to NULL:
SetNull(Salary)
dawugui 2007-12-19
  • 打赏
  • 举报
回复
Description

Sets a variable to NULL. The variable can be any datatype except for an array, structure, or autoinstantiated object.

Syntax

SetNull ( anyvariable )

Argument Description
anyvariable The variable you want to set to NULL
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL, SetNull returns NULL.

Usage

Use SetNull to set a variable to NULL before writing it to the database. Note that PowerBuilder does not initialize variables to NULL; it initializes variables to the default initial value for the datatype unless you specify a value when you declare the variable.
If you assign a value to a variable whose datatype is Any and then set the variable to NULL, the datatype of the NULL value is still the datatype of the assigned value. You cannot untype an Any variable with the SetNull function.


This statement sets the variable Salary to NULL:

SetNull(Salary)
dawugui 2007-12-19
  • 打赏
  • 举报
回复
setnull()
jlwei888 2007-12-19
  • 打赏
  • 举报
回复
date dt

setnull(dt)



1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧