Re: [Dbix-class] DBIx giving err due to camleCase??? not sure..

2017-08-22 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIx giving err due to camleCase??? not sure..

2017-08-21 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIx giving err due to camleCase??? not sure..

2017-08-21 Thread Rajeev Prasad
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

[Dbix-class] DBIx giving err due to camleCase??? not sure..

2017-08-20 Thread Rajeev Prasad
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    

Re: [Dbix-class] find_or_create did it find or created?

2017-08-20 Thread Rajeev Prasad
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

Re: [Dbix-class] searching decimal colum

2017-08-18 Thread Rajeev Prasad
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

[Dbix-class] searching decimal colum

2017-08-18 Thread Rajeev Prasad
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     

[Dbix-class] find_or_create did it find or created?

2017-08-18 Thread Rajeev Prasad
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

[Dbix-class] Strangely does DBIx change table names from MySQL?

2017-03-10 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIx HAVING and COUNT error

2016-09-05 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIx HAVING and COUNT error

2016-09-04 Thread Rajeev Prasad
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-class] DBIx HAVING and COUNT error

2016-09-02 Thread Rajeev Prasad
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 ] }},                 {       

[Dbix-class] how to repersent N:M in DBIx?

2016-08-31 Thread Rajeev Prasad
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::->

Re: [Dbix-class] fetching a column value directly

2013-11-04 Thread Rajeev Prasad
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

[Dbix-class] fetching a column value directly

2013-11-03 Thread Rajeev Prasad
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

[Dbix-class] why is this returning an hash?

2013-05-15 Thread Rajeev Prasad
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(     {

Re: [Dbix-class] what is the err in this DBIx select...

2013-04-16 Thread Rajeev Prasad
...@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

[Dbix-class] what is the err in this DBIx select...

2013-04-15 Thread Rajeev Prasad
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)

Re: [Dbix-class] update a row only if any column has changed

2013-04-06 Thread Rajeev Prasad
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

[Dbix-class] update a row only if any column has changed

2013-04-05 Thread Rajeev Prasad
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

[Dbix-class] how to empty a Table? when there is no primary key

2013-03-24 Thread Rajeev Prasad
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():

Re: [Dbix-class] how to build this query? col1 not like %xx% AND col1 like %yy%

2013-03-20 Thread Rajeev Prasad
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

[Dbix-class] how to build this query? col1 not like %xx% AND col1 like %yy%

2013-03-19 Thread Rajeev Prasad
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:

[Dbix-class] DBIx Schema Loader ownership question.

2013-02-27 Thread Rajeev Prasad
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/,

Re: [Dbix-class] Re: help needed in forming a 'and' and 'or' select query using DBIx::Class

2013-01-21 Thread Rajeev Prasad
  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

[Dbix-class] help needed in forming a 'and' and 'or' select query using DBIx::Class

2013-01-18 Thread Rajeev Prasad
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 =

[Dbix-class] list 2 columns for all records in table not working

2012-10-16 Thread Rajeev Prasad
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

Re: [Dbix-class] list 2 columns for all records in table not working

2012-10-16 Thread Rajeev Prasad
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

[Dbix-class] resultset search question

2012-10-09 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIX, row update problem

2012-10-04 Thread Rajeev Prasad
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

[Dbix-class] DBIX, row update problem

2012-10-03 Thread Rajeev Prasad
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     );

[Dbix-class] DBIx how to update_or_create a table with primary index is autoincrement ? getting erroneous data

2012-09-27 Thread Rajeev Prasad
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        

Re: [Dbix-class] DBIx how to update_or_create a table with primary index is autoincrement ? getting erroneous data

2012-09-27 Thread Rajeev Prasad
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

Re: [Dbix-class] DBIx how to update_or_create a table with primary index is autoincrement ? getting erroneous data

2012-09-27 Thread Rajeev Prasad
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

[Dbix-class] search any matching word in given string in table column which has only one word

2012-08-11 Thread Rajeev Prasad
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|

Re: [Dbix-class] search any matching word in given string in table column which has only one word

2012-08-11 Thread Rajeev Prasad
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

[Dbix-class] DBIx schema loader (dump schema using make_schema_at) wierd behaviour

2012-08-07 Thread Rajeev Prasad
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

[Dbix-class] how to avoid adding duplicate row to table containing unique field/column

2011-10-12 Thread Rajeev Prasad
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.

Re: [Dbix-class] how to avoid adding duplicate row to table containing unique field/column

2011-10-12 Thread Rajeev Prasad
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

Re: [Dbix-class] how to avoid adding duplicate row to table containing unique field/column

2011-10-12 Thread Rajeev Prasad
, 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

Re: [Dbix-class] Can't find source in DBIx::Class::Schema::resultset()

2011-10-07 Thread Rajeev Prasad
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

[Dbix-class] not able to list any records from database

2011-09-01 Thread Rajeev Prasad
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 =

Re: [Dbix-class] getting error; DBIx::Class not finding Schema created with schema loader

2011-08-30 Thread Rajeev Prasad
/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

Re: [Dbix-class] getting error; DBIx::Class not finding Schema created with schema loader

2011-08-30 Thread Rajeev Prasad
,   { 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

[Dbix-class] getting error; DBIx::Class not finding Schema created with schema loader

2011-08-29 Thread Rajeev Prasad
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

Re: Subject: [Dbix-class] Re: using as normal perl module To

2011-08-01 Thread Rajeev Prasad
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

Re: [Dbix-class] Re: using as normal perl module

2011-07-29 Thread Rajeev Prasad
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

[Dbix-class] using as normal perl module

2011-07-28 Thread Rajeev Prasad
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.