[Dbix-class] searching decimal colum

Rajeev Prasad rp.neuli at yahoo.com
Fri Aug 18 19:35:49 GMT 2017

before i go an do some operations. i need to know if the following will work?

so I have this column:

I want to run two queries
1. select all rows with 23 before decimal (not *23.*, just 23.*).
my @foo = $schema    ->resultset('Test')
        col1 => { like => 23'.%'}
print "values @foo\n";

I expect:23.3323.4623.54623.1
2. second i want to run query to select for given value after decimal.my $foo_rs = $schema->resultset('Table')->search({
                                                        col1 => { like => 23.'%' }});
I expect:23.3312.3310.331.33100.33

I get this error when i test:
$ ./test.pl
String found where operator expected at ./test.pl line 26, near "23'.%'"
        (Missing operator before '.%'?)
Possible unintended interpolation of @foo in string at ./test.pl line 29.
syntax error at ./test.pl line 26, near "23'.%'"
Global symbol "@foo" requires explicit package name (did you forget to declare "my @foo"?) at ./test.pl line 29.
Execution of ./test.pl aborted due to compilation errors.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20170818/596a00c8/attachment.htm>

More information about the DBIx-Class mailing list