1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_sprintf_iri_or_null">
<refmeta>
<refentrytitle>sprintf_iri_or_null</refentrytitle>
<refmiscinfo>string</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sprintf_iri_or_null</refname>
<refpurpose>returns a formatted IRI string or null if any of the arguments except the first is null.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_sprintf_iri_or_null">
<funcprototype id="fproto_sprintf_iri_or_null">
<funcdef><function>sprintf_iri_or_null</function></funcdef>
<paramdef><parameter>format</parameter> string</paramdef>
<paramdef><parameter>arg_1</parameter> any</paramdef>
<paramdef><parameter>...</parameter> </paramdef>
<paramdef><parameter>arg_x</parameter> any</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc"><title>Description</title>
<para>sprintf_iri_or_null is similar to sprintf_iri and returns a new string formed by "printing" a variable number
of arguments arg_1 - arg_x according to the format string format. The difference is that the function can return
null if any of the arguments except the first one is null.</para>
<para>The returned string is marked as being IRI string so some applications and clients may distinguish between RDF reference string and RDF literal.</para>
<note><para>No matter what is the default server charset or default encoding of host OS, IRI strings are supposed to be in UTF-8 encoding so string arguments to print as well as the format itself are supposed to be UTF-8. Application may use calls of <link linkend="fn_charset_recode"><function>charset_recode</function></link> as arguments.</para></note>
</refsect1>
<refsect1 id="examples_sprintf_iri_or_null">
<title>Examples</title>
<example id="ex_sprintf_iri_or_null"><title>Simple Use</title>
<screen><![CDATA[
create function job_history(
in EMPLOYEE_ID integer,
in START_DATE date) returns varchar
{
return sprintf_iri_or_null
('http://demo.openlinksw.com:8890/hr/job_history#%d_%s',
EMPLOYEE_ID, cast (START_DATE as varchar) );
};
]]></screen>
</example>
</refsect1>
</refentry>
|