Bug #69

Updated by Pierre Marc over 12 years ago

When doing a SQL command for INSERT or REPLACE and using a pipe "|" character within the VALUES to be inserted the resulting select results in to NVDATA objects for the cell where the pipe was inserted - consider the following perl procedure:

<pre>

use @use strict;
NV::Command("NV_CMD=|FILEDB:OPEN| FILENAME=|C:\\MYDB.DB| NAME=|MyDB|");
NV::Command("NV_CMD=|FILEDB:SQL| NAME=|MyDB| SQL=|CREATE TABLE TEST (MYIND INT, MYFIELD INT, UNIQUE(MYIND) ON CONFLICT REPLACE)| NV_NO_ERROR=|YES|");
NV::Command("NV_CMD=!FILEDB:SQL! NAME=!MyDB! SQL=!INSERT OR REPLACE INTO TEST (MYIND,MYFIELD) VALUES (1,'that=|that|')!");
NV::Command("NV_CMD=|FILEDB:SQL| NAME=|MyDB| SQL=|SELECT * FROM TEST|");
NV::Command("NV_CMD=|FILEDB:CLOSE| NAME=|MyDB|");
The resulting table is shown as:
- <NVOBJ name="records" type="TABLE">
<NVDESCRIPTION />
<NVSIZE>1</NVSIZE>
<NVPRIMARY case-sensitive="no" />
<NVCOLDESC name="MYIND" type="ALPHANUMERIC" />
<NVCOLDESC name="MYFIELD" type="ALPHANUMERIC" />
- <NVROW>
- <NVCOL name="MYIND">
<NVDATA>1</NVDATA>
</NVCOL>
- <NVCOL name="MYFIELD">
<NVDATA>that=</NVDATA>
<NVDATA>that</NVDATA>
</NVCOL>
</NVROW>
</NVOBJ>

</pre>

It @It seems that the pipe "|" character has been seen internally by Nirva as a separator of lines in the table's cell - of course the "|" is the default value for LINESEP but I was wondering is there a way to change this on the FILEDB:SQL command so a different delimiter is used when the command generates the table?

Back