not giving DBIC a way to identify the
*single* row to match to “find”.
Hope this helps,Henry
On Aug 21, 2017, at 5:41 PM, Rajeev Prasad <rp.ne...@yahoo.com> wrote:
that does not work.
i get this err:
DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): Unable to
satisfy
yadav <yadav.tirv...@gmail.com>
wrote:
On Mon, Aug 21, 2017 at 7:15 PM, Rajeev Prasad <rp.ne...@yahoo.com> wrote:
> no, nodeID is auto increment field as seen in tabel description. it is
> complaining there is no such key. i dont know why...
>
>
>
> On Monday, Au
no, nodeID is auto increment field as seen in tabel description. it is
complaining there is no such key. i dont know why...
On Monday, August 21, 2017 7:39 AM, tirveni yadav <yadav.tirv...@gmail.com>
wrote:
On Mon, Aug 21, 2017 at 6:50 AM, Rajeev Prasad <rp.ne...@yahoo.c
why am i getting this err in DBIx::Class ?
$./update_db.pl
DBIx::Class::ResultSource::unique_constraint_columns(): Unknown unique
constraint nodeid on 'node' at ./update_from_ieds.pl line 80
relevant code:
...
sub addNode
{
my $node = shift; my $lcNode = lc($node);
my $id = $schema
is explained in the documentation for find_or_create, starting with “If
> you need to know if an existing row was found or a new one created…”.
>
>
> On Aug 18, 2017, at 10:34 , Rajeev Prasad <rp.ne...@yahoo.com> wrote:
>
> How do we know wether this function 'found' or created what
i found the solution:
my $n = 33;
my $foo_rs = $schema
->resultset('Test')
->search
({
col1 => { like => '%.'.$n }
})->count;
On Friday, August 18, 2017 2:35 PM, Rajeev Prasad <rp.ne...@yahoo.com>
wrote:
before i go an do some opera
before i go an do some operations. i need to know if the following will work?
so I have this column:
col123.3323.4612.3310.3323.54623.11.33100.33
I want to run two queries
1. select all rows with 23 before decimal (not *23.*, just 23.*).
my @foo = $schema ->resultset('Test')
->search
How do we know wether this function 'found' or created whatever was being asked
to 'find_or_create' ???
my $id = $schema
->resultset('Node')
->find_or_create
(
{ nodeName => $node },
{ key => 'nodeID' }
);
how do we know wether $id was
Hello,
Note: this question is also posted on Stack Overflow, a few minutes back.
|
| While using ./create-schema-mydb.pl I realized that the table name "People"
is changed to "Person" in DBIx. I am not sure how? or why?
It is not even a reserved word.
in MySQL:people innoDB utf8
n Monday, September 5, 2016 12:02 AM, Dmitry L. <dim0...@gmail.com> wrote:
HAVING COUNT(1) = 3
vs
HAVING count 1 = 1
On 5 September 2016 at 06:13, Rajeev Prasad <rp.ne...@yahoo.com> wrote:
> hello all,
>
> thanks for response. sorry if i sent email directly to you. (i th
onverts to:
SELECT me.i_id, me.t_id FROM itemList me
WHERE ( t_id IN ( 55 ) )
GROUP BY i_id
HAVING count 1 = 1
what is wrong in this SQL??. (I am assuming that by now DBIx syntax is
good)
On Saturday, September 3, 2016 4:17 AM, Stefan Hornburg (Racke)
<ra...@linuxia.de> wrot
DBIx error in webserver log:
[cgi:error] [pid 29640] ... AH01215: Can't locate object method "HAVING" via
package "COUNT" (perhaps you forgot to load "COUNT"?)
the query:
my $obj_rs = $schema->resultset('itemList')->serach(
{ t_id => { -in => [ $tStr ] }},
{
Pl refer to this link, it has my exact problem (but it only tells about SQL
solution):
http://stackoverflow.com/questions/11409869/mysql-nm-relationship-find-rows-with-several-specific-relations
I have three tables:1. products:-> prod-id, prod-name
2. tags:-> tag-id, tag-name
3. product_tags::->
thx all !!!
On Monday, November 4, 2013 1:46 AM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 da...@cpan.org wrote:
Your code is correct. `search` may return several results, so you must
either iterate over them or assign/do something with all the results,
e.g.
-search(…)-all
returns a list of Host resultrow
hello,
I have this host table, which has all unique records. So i want to get a
specific column value for a specific host. i am doing below, but i think it is
not efficient. is there a better way?
my $hostAdd_rs =
$schema-resultset('Host')-search({host=$host},{select=[qw/addr/]});
while (my
from here i understood, that if i collect output in array element, i will get
an array.
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/ResultSet.pm#search
in below, $id is unique in the table, so it returns just one row.
my @item_array = $schema-resultset('Mytable')-search(
{
...@gmail.com
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Sent: Tuesday, April 16, 2013 6:32 AM
Subject: Re: [Dbix-class] what is the err in this DBIx select...
You need the first arg to search there to be [ ... ] rather than { ... }.
On 15
I am meaning to run...
search records where:
if item_type='XX' _then_ item column should contain '%01par%' or
'%01pqt%'
and,
if item_type='YY' OR item_type='YZ' _then_ item column should contain
'%00mxz%'
and,
for all other item_type no condition (select them)
thx Brendan,
the source is a text file. I guess I will use MySQL tools to load it into the
database everyday, deleting the table completely before recreating.
i guess thats the best way?
From: Brendan Byrd p...@resonatorsoft.org
To: Rajeev Prasad rp.ne
hello,
I have a table with around 2,000,000 records (15 columns). I have to sync this
from an outside source once everyday. not all records are changed/removed
/new-added everyday. so what is the best way to update only those which have
changed/added/or deleted?
i can use update_or_create but
I tried to use delete_all, but there is no primary key in the table so it
failed. what else can i do?
I need to delete all rows from a table and then add new ones based on logic.
this happens once a day
$schema-resultset('Mytable')-delete_all;
DBIx::Class::ResultSet::delete_all():
thanks Paul, very helpful. and to the point. I was able to chain resultset.
- Original Message -
From: Paul Findlay paul.find...@fonterra.com
To: DBIx::Class user and developer list dbix-class@lists.scsys.co.uk
Cc:
Sent: Tuesday, March 19, 2013 8:26 PM
Subject: RE: [Dbix-class] how to
Hello,
I tried quite a few things, but it is not working...
col1 not like %xx% AND col1 like %yy%
OR, if someone can tell me how can i run a select query again on an rs obtained
by running a select query on table.
ty.
___
List:
I am running following code as myself. but the resulting folders are being
created as www:other I am not able to understand why is that so?
use strict;
use warnings;
use DBIx::Class::Schema::Loader qw/make_schema_at/;
make_schema_at(
Mydb::Schema,
{debug = 0, dump_directory = ../db/,
Thanks to all for help and explanation as to why so.
I liked the below solution the best. thx again.
From: Dagfinn Ilmari Mannsåker ilm...@ilmari.org
To: dbix-class@lists.scsys.co.uk
Sent: Monday, January 21, 2013 4:34 AM
Subject: [Dbix-class] Re: help
Hello,
I am trying to build a query based on two column values as folows:
columnA = x (one char, any char - not null)
columnB = zz _or_ x,xx,yyy,mm (comma seperated values or just one value)
I am looking for rows where: (columnB contains either zz or mm...)
columnA = x AND ( columnB =
this straight lift from documentation is not working. what could i be doing
wrong?
my @all_artists = $schema-resultset('Artist')-search(undef, { columns =
[qw/name artistid/], });
my query is:
my @items = $schema-resultset('Itemlist')-search(
undef, #no search condition means all
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Sent: Tuesday, October 16, 2012 9:30 PM
Subject: RE: [Dbix-class] list 2 columns for all records in table not working
Hi Rajeev,
You are tried to print an array, and then tried to print each object
Hello, I guess a very basic question.
In the following example: from
http://search.cpan.org/~mstrout/DBIx-Class-0.08202/lib/DBIx/Class/ResultSet.pm
my @cds = $cd_rs-search({ year = 2001 }); # ... WHERE year = 2001 my
$new_rs = $cd_rs-search({ year = 2005 });
are we to understand that, table
thank you Aaron, that was perfect.
From: Aaron Crane dbix-cl...@aaroncrane.co.uk
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Sent: Thursday, October 4, 2012 5:51 AM
Subject: Re: [Dbix-class] DBIX, row
I am only intending to update a column in a row based on 'item' value. Item
value is unique constraint column.
DBIx code:
$schema-resultset('Itemlist')-update(
{
item = $item,
item_comment = $mycomments
},
{key ='item'} #uniq constraint on item
);
friends,
I have a Table to update (empty right now), and the regularly 'update' existing
info with changes AND add any new record which come up.
source data is coming from file. one record per line.
my @my_arr; #has 500 uniq entries
that means my update_or_create is never going to work on an empty table???
really? I am stuck pl help.
From: Rajeev Prasad rp.ne...@yahoo.com
To: DBIx::Class and developer list dbix-class@lists.scsys.co.uk
Sent: Thursday, September 27, 2012 11:55 AM
Subject: [Dbix
To: Rajeev Prasad rp.ne...@yahoo.com
Cc: DBIx::Class user and developer list dbix-class@lists.scsys.co.uk
Sent: Thursday, September 27, 2012 1:03 PM
Subject: Re: [Dbix-class] DBIx how to update_or_create a table with primary
index is autoincrement ? getting erroneous data
Yes, that is correct
here is given string of type:... as23,rt54,yh79
and i have to lookup in a table which has column id which has only one four
letter word. i have to select that row in which the colum 'id' value matches
any of the word in given string...
table column: id
contents like:
| id|
|sd32|
|wa32|
thanks a lot that worked!
From: Rodrigo rodrigol...@gmail.com
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Cc: mysql list my...@lists.mysql.com
Sent: Saturday, August 11, 2012 11:12 AM
Subject: Re
Hello,
am I missing anything? when I dump schema of my database using schema loader's
make_schema_at. Some .pm file names under Result corrosponding to folders have
names chnaged! they do not match to table names!!
e.g. table name costlycookies shows up as Costlycooky.pm !!! another table
Hello,
In my test script below, i am trying to figure out how to suppress the error
mesg when the the script try to add a previously presen tentry into the table.
OR better even, to make sure that the script should not even try to update the
table, if the record is already present in table.
there is a find_and_create function which can do the job, i am not able to find
help on it. does anyone know?
From: Rajeev Prasad rp.ne...@yahoo.com
To: dbix-class@lists.scsys.co.uk dbix-class@lists.scsys.co.uk
Sent: Wednesday, October 12, 2011 10:33 AM
, Oct 12, 2011 at 12:06, Rajeev Prasad rp.ne...@yahoo.com wrote:
there is a find_and_create function which can do the job, i am not able to
find help on it. does anyone know?
From: Rajeev Prasad rp.ne...@yahoo.com
To: dbix-class@lists.scsys.co.uk dbix
i referred to dbi schem like below, it is working...
use lib '../testdb';
use Mysqltestdb::Schema;
testdb folder is under which schema is dumped. it is same level as script
folder, so ../testdb
- Original Message -
From: tza...@free.fr tza...@free.fr
To: dbix-class@lists.scsys.co.uk
follwoing code is not printing anything... can anyone help plz?
#!/usr/bin/perl
use strict;
use warnings;
use lib '../testdb';
use Mysqltestdb::Schema;
my ($schema, $user, $users_rs);
my (@newusers, @oldusers);
$schema =
/userid/],
@users,
]);
===
From: Uwe Völker u...@uwevoelker.de
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Sent: Tuesday, August 30, 2011 2:53 AM
Subject: Re: [Dbix-class] getting
,
{ data_type = varchar, is_nullable = 1, size = 10 },
);
__PACKAGE__-set_primary_key(userid);
1;
From: Uwe Völker u...@uwevoelker.de
To: Rajeev Prasad rp.ne...@yahoo.com; DBIx::Class user and developer list
dbix-class@lists.scsys.co.uk
Sent: Tuesday, August 30, 2011 2:53 AM
Subject: Re: [Dbix-class
I tried mentioning the path where schema was created, but i am getting error:
can someone hel resolve? thx. Rajeev
/home/someplace/cgi-bin/insertdb.pl
/home/someplace/testdb/Mysqltestdb/Schema/ResultSet
insertdb.pl===
#!/usr/bin/perl
use strict;
use
table i got:
DBIx::Class::Schema::Loader::make_schema_at(): table has no primary key at
./create-schema-script.pl line 8
From: Rajeev Prasad rp.ne...@yahoo.com
To: DBIx::Class user and developer list dbix-class@lists.scsys.co.uk
Sent: Monday, August 1, 2011 2:01
Hello Adam,
thank you.I am totally new to DB access using perl. I have looked at perl DBI
and DBIx::Class. I can get up to speed on DBI comparatively easily i guess.
(But), i want to start and stick to DBIx::Class, as i want to eventually use
Catalyst. Catalyst prefers DBIx::Class, so wanted
Hello,
all the examples i see are of using the module in a webapp (built with
catalyst). I am only trying to use it in my cgi perl programe, but finding very
less documentation. can someone please refer a URL or small script which stores
and retrieves data from a table using this module plz.
48 matches
Mail list logo