
Description
Disconnects the current username from the database
A session exists from the execution of the connect() until the logout() is executed
You do not need to disconnect the current username from the database to reconnect to the database with the different username
The current user is logged out of the database automatically when you quit the SQeeL
The current transaction to the database is rolled back. (It does not commit pending changes to the database)

Syntax
ret = logout()

Return Value

System Return Value
ERROR
DBERR
DBERRMSG
DBUSER
| 文字列 | | Connected username to database |

See Also

Requirements
dboralib.slb

Example
require 'dboralib.slb'
run()
exit
function run()
connect('scott/tiger')
logout()
endfunction

Description
Returns the natural logarithm (base e) of a given number

Syntax
ret = log(e)

Parameters

Return Value
| real number | : | Result | |
| 0 | : | Error or result | |

System Return Value
ERROR
| 0 | | Success |
| 1 | | Argument error |
| 14 | | Argument is negative |

Example
//[result example]
//
// input number:2.3123
// log(2.3123) = 0.838243
//
exit get_log()
function get_log()
local input = 0
input = getopt('input number: ')
print("log("&input&") = "& log(input) )
endfunction

Description
Returns the common logarithm (base 10) of a given number

Syntax
ret = log10(e)

Parameters

Return Value
| real number | : | Result | |
| 0 | : | Error or result | |

System Return Value
ERROR
| 0 | | Success |
| 1 | | Argument error |
| 14 | | Argument is negative |

Example
//[result example]
//
// input number:1000
// log10(1000) = 3.000000
//
exit get_log10()
function get_log10()
local input = 0
input = getopt('input number: ')
print("log10("&input&") = "& log10(input) )
endfunction

Description
The current line of the file executed

Read / Write
r

Type
number

initial value
undefined

Description
Returns the length in characters of the value of STRING.

Syntax
ret = length(string)

Parameters

Return Value
| integral number | : | Length of character string | |

System Return Value

Example
//[result example]
//
//"Insight" length:7
//"Technology" length:9
//"Insight Technology" length:17
//
run()
exit
function run()
local a = 'Insight'
local a = 'Technology'
local c = a & b
print('"' & a & '" length :' & length(a) & '\n',stdout)
print('"' & b & '" length :' & length(b) & '\n',stdout)
print('"' & c & '" length :' & length(c),stdout)
endfunction

Description
Converts character string to lower-case letters

Syntax
ret = lower(string)

Parameters
| string | : | Character string to be converted to lower-case character |

Return Value
| string | : | Converted character string | |

System Return Value

See Also

Example
//[result example]
//
// insight technology
//
run()
exit
function run()
local a = 'INSIGHT TECHNOLOGY'
print(lower(a),stdout)
endfunction

Description
Pads the string specified by STRING2 to left side of STRING1. Returns the part of string specified by N parameters
If the length in characters of the value of STRING1 is longer than N parameters, returns the part in STRING1 within N parameters.

Syntax
ret = lpad(string1,n,string2)

Parameters
| string1 | : | Character string to be converted |
| n | : | Length of character string after conversion |
| string2 | : | Character string to be padded Default: single blank space |

Return Value
| string | : | Converted character string | |

System Return Value

See Also

Example
//[result example]
//
// 1:12345
// 2:ab12345678
//
run()
exit
function run()
local a = '12345678'
local b = 'abcdefg'
print(lpad(a, 5,b))
print(lpad(a,10,b))
endfunction

Description
Delete characters from the left side of the character string until the specified character(deletion_char) is found.
Delete blank space from the character string when the character(deletion_char) is not specified

Syntax
ret = ltrim(string,deletion_char)

Parameters
| string | : | Character string to be converted |
| deletion_char | : | Character string containing a letter to be deleted Default: single blank space |

Return Value
| string | : | Converted character string | |

System Return Value

See Also

Example
//[result example]
//
// XxyINSIGHT
//
run()
exit
function run()
local a = 'xyxyyXxyINSIGHT'
local b = 'yx'
print(ltrim(a, b))
endfunction