<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Editing SQL correct query generate SQL error if inserting a parameter"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=139600">139600</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Editing SQL correct query generate SQL error if inserting a parameter
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>6.4.5.2 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Base
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>diego.ercolani@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>I have a bacula installation (mariadb based) I connect correctely with dbbeaver
via JDBC and also with libreofficebase. I finally have to implement this query
written via SQL:
SELECT
MediaId
,VolumeName
,Slot
,VolStatus
,Enabled
,VolBytes
,VolFiles
,VolRetention
,Recycle
,MediaType
,VolType
,VolParts
,LastWritten
,ExpiresIn FROM
(
SELECT
MediaId
,CAST(VolumeName AS VARCHAR(20)) AS VolumeName
,VolStatus
,Enabled
,VolByte
,VolFiles
,VolRetention
,Recycle
,CONCAT ( CASE
WHEN Slot < 13 THEN 'Left '
ELSE 'Right '
END
, Slot ) AS Slot
,CAST( MediaType AS VARCHAR(10)) AS MediaType
,VolType
,VolParts
,LastWritten
,GREATEST(
0
, CAST(UNIX_TIMESTAMP(LastWritten) AS INTEGER)
+ CAST(VolRetention AS INTEGER)
- CAST(UNIX_TIMESTAMP(NOW()) AS INTEGER)) AS ExpiresIn
FROM Media WHERE
InChanger = 1
ORDER by ExpiresIn DESC LIMIT :ask
) AS InsiemeNastri
ORDER BY Slot
The problem is:
If I save the query "as is" or try to run, it fail with a "SQL Syntax Error".
If I substitute the ":ask" parameter with a number (e.g. 6) It works and I can
run the query correctly. If I try to view it in "design mode" it fails with
"SQL Error". I'm going to port the error in hsqldb so I can add the attachment
to this bug</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>