pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedconcat returns null
3+ messages / 3 participants
[nested] [flat]
* concat returns null
@ 2007-12-18 11:16 abyss <kurjak@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: abyss @ 2007-12-18 11:16 UTC (permalink / raw)
To: pgsql-jdbc
I don't know if it's bug or feature but
select 'test' || null as result
returns null,
so i need to case second parameter not to concat if it is null...
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: concat returns null
@ 2007-12-18 11:28 tivvpgsqljdbc@gtech-ua.com
parent: abyss <kurjak@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: tivvpgsqljdbc@gtech-ua.com @ 2007-12-18 11:28 UTC (permalink / raw)
To: abyss <kurjak@gmail.com>; +Cc: pgsql-jdbc
abyss wrote:
> I don't know if it's bug or feature but
> select 'test' || null as result
> returns null,
> so i need to case second parameter not to concat if it is null...
It's and SQL feature that neither specific to JDBC nor PostgreSQL. Most
SQL functions return null if any of parameters is null.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: concat returns null
@ 2007-12-26 03:49 Andrew Lazarus <drlaz@attglobal.net>
parent: abyss <kurjak@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lazarus @ 2007-12-26 03:49 UTC (permalink / raw)
To: abyss <kurjak@gmail.com>; +Cc: pgsql-jdbc
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal text */
{
font-size: 12pt;
font-family: 'Garamond';
font-style: normal;
font-weight: normal;
color: #000000;
text-decoration: none;
}
span.rvts1 /* Heading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #0000ff;
}
span.rvts2 /* Subheading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #000080;
}
span.rvts3 /* Keywords */
{
font-size: 10pt;
font-family: 'Arial';
font-style: italic;
color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
span.rvts6
{
font-size: 9pt;
font-family: 'tahoma';
font-weight: bold;
color: #ffffff;
background-color: #0000ff;
}
span.rvts7
{
font-size: 9pt;
font-family: 'tahoma';
}
span.rvts8
{
font-size: 10pt;
font-family: 'gill sans mt';
font-style: italic;
color: #800000;
}
a.rvts9, span.rvts9
{
font-size: 10pt;
font-family: 'gill sans mt';
color: #0000ff;
text-decoration: underline;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
--></style>
</head>
<body>
<p> Hello abyss,</p>
<p>Check out the built-in function COALESCE which will do your special-casing for you</p>
<p><br></p>
<p>Tuesday, December 18, 2007, 3:16:31 AM, you wrote:</p>
<p><br></p>
<div><table border=0 cellpadding=1 cellspacing=2>
<tr valign=top>
<td width=13 style="background-color: #0000ff;">
<p><span class=rvts6>></span></p>
</td>
<td width=1142 style="background-color: #ffffff;">
<p><span class=rvts7>I don't know if it's bug or feature but </span></p>
<p><span class=rvts7>select 'test' || null as result</span></p>
<p><span class=rvts7>returns null, </span></p>
<p><span class=rvts7>so i need to case second parameter not to concat if it is null...</span></p>
<p><br></p>
</td>
</tr>
</table>
</div>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts8>-- </span></p>
<p><span class=rvts8>Best regards,</span></p>
<p><span class=rvts8> Andrew </span><a class=rvts9 href="mailto:drlaz@attglobal.net">mailto:drlaz@attglobal.net</a></p>
</body></html>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-12-26 03:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-12-18 11:16 concat returns null abyss <kurjak@gmail.com>
2007-12-18 11:28 ` tivvpgsqljdbc@gtech-ua.com
2007-12-26 03:49 ` Andrew Lazarus <drlaz@attglobal.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox