# 22. Virtuoso Functions Guide - atoi

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
ascii
atoi
blob_to_string
blob_to_string_outpu...
chr
initcap
isblob
isstring
lcase
left
length
locate
ltrim
make_string
regexp_instr
regexp_like
regexp_match
regexp_parse
regexp_replace
regexp_substr
repeat
replace
right
rtrim
search_excerpt
serialize
space
split_and_decode
sprintf
strcasestr
strchr
string_output
string_output_flush
string_output_gz_com...
string_output_string
string_to_file
strrchr
strstr
subseq
substring
tmp_file_name
trim
ucase
upper
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## atoi

Convert a string to an integer
atoi (in arg string);
Parameters
arg – A string input parameter
Return Types

The string converted to an integer. If the string is a number then the absolute value of the literal will be returned as an integer. Otherwise 0 is returned.

Description

atoi returns its argument as an integer. If the string cannot be parsed and converted to a valid integer, a value 0 is returned.

Examples
Simple examples

    SQL> select atoi('1.23456789');
    callret
    INTEGER
    _______________________________________________________________________________

    1

    1 Rows. -- 5 msec.

    SQL> select atoi ('Cadena de los patos amarillos');
    callret
    INTEGER
    _______________________________________________________________________________

    0

    1 Rows. -- 4 msec.

See Also

atof