Hi Tom,
Thanks for your quick response. Sorry for my delayed reply.
I followed your suggestion, and it works like a charm (except that ODBC is
_very_ strange with some embedded calculations--not your problem).
I changed my dbish instantiation batch file to automagically make the backslash
a command character to match the mysql client:
call dbish.bat -command_prefix=[\\;] %*
Would you like me to retract the bug report or mark it resolved?
Thanks again,
--
Joe Calkins
jcalkins@swcp.com
mobile (505) 321-6030
On 28 Aug 2006 at 21:55, Thomas A. Lowery via RT wrote:
<URL:
http://rt.cpan.org/Ticket/Display.html?id=21200 >
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
jcalkins@swcp.com via RT wrote:
Show quoted text> Sun Aug 27 21:41:23 2006: Request 21200 was acted upon.
> Transaction: Ticket created by jcalkins@swcp.com
> Queue: DBI-Shell
> Subject: No escape for slash (/) to allow its use in a SQL statement.
> Broken in: (no value)
> Severity: Normal
> Owner: Nobody
> Requestors: jcalkins@swcp.com
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=21200 >
>
>
> Using "select 1/2;" causes an error "Command '2' not recognised".
> Dividing in a SQL statement is sometimes important. Let's say I want to
> find stock prices that are evenly divisible by 5.00 because my quote
> provider is giving lots of bad quotes. There's no floor() function in
> ODBC, so I use "select Symbol, QuoteTime, Last_Price from Watch_Detail
> where Last_Price/5 = int(Last_Price/5);" This causes an error in dbish
> but works great in Perl.
There's a problem with the Regex that determines what is and isn't a
command. I've attempted to fix the problem over the years but haven't
had success. The simplest work around is to change the command_prefix
using the opt command or in your .dbish_config file.
The only thing to note is that the command_prefix applies to all
command not just execute.
@> select 1;
1
'1'
[1 rows of 1 fields returned]
@> select 1 / 2;
1
'1'
[1 rows of 1 fields returned]
@> /opt
batch: 0
chistory_size: 50
command_prefix: [/;]
command_prefix_end: ;
command_prefix_line: /
debug: 0
desc_format: partbox
desc_show_columns:
COLUMN_NAME,DATA_TYPE,TYPE_NAME,COLUMN_SIZE,PK,NULLABLE,COLUMN_DEF,IS_NULLABLE,REMARKS
desc_show_long: 1
desc_show_remarks: 1
editor: vi
format: neat
home_dir: /home/tlowery
init_autocommit: 1
init_trace: 0
prompt:
rhistory_head: 5
rhistory_size: 50
rhistory_tail: 5
seperator: ,
sqlpath: .
tmp_dir: undef
tmp_file: dbish8395.sql
user_level: 1
@> /opt command_prefix=;
/option command_prefix=; (was [/;])
@> select 1 / 2;
1 / 2
'0.50'
[1 rows of 1 fields returned]
Hope this helps.
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE -
http://enigmail.mozdev.org
iD8DBQFE856h3Tj212QIeB4RAvYkAJ9hkWew2IqRFEfwbXwDepiYZQk8IQCfYOHk
rjyzaCk/A0Ls7CrkZY/uU8I=
=5iuq
-----END PGP SIGNATURE-----