Displaying 20 results from an estimated 2000 matches similar to: "find_by_sql timestamp parameter"
2004 Jun 13
1
can't create a POSIXct from an actual Unix timestamp (PR#6975)
Full_Name: Philip Gross
Version: 1.9.0
OS: Linux Redhat 9.0
Submission from: (NULL) (65.57.245.11)
Among the many conversions for POSIXct values, there does not seem to be one
which will accept an actual POSIX timestamp, e.g. as produced by MySQL's
UNIX_TIMESTAMP() function. I have fixed this by adding the following lines to
R-1.9.0/src/library/base/R/datetime.R , at line 89:
2010 Oct 18
1
a2billing
Not sure if a2billing can be shared here, but ill give a shot
If the credit < min_credit the IVR play: sorry you have 0 credit and hangup,
I want it to FW me to the IVR to add voucher, please let me know: here is
log:
[18/10/2010 07:01:12]:[file:a2billing.php -
line:75]:[CallerID:]:[CN:]:[IDCONFIG : 1]
[18/10/2010 07:01:12]:[file:a2billing.php - line:76]:[CallerID:]:[CN:]:[MODE
: standard]
2008 Oct 10
1
Asterisk CDR Analyser
Hi All,
I'm stuck and need some help. I have installed the Asterisk CDR
Analyser Version 2.0.1. It mostly works except for the CDR Report. I
get the following error even though it lists the CDR details.
Database error: Invalid SQL: SELECT substring(calldate,1,10) AS day,
sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE
UNIX_TIMESTAMP(calldate) >=
2019 Nov 12
3
CDR extract call numbers on interval on unique callers
hi,
we want to extract the information when the most callers are entering
our phone system based on an interval of 15 minutes. this is quite
simple (although not perfect) with
select calldate, count(*) as anzahl from cdr where calldate >
'2019-10-12' group by unix_timestamp(calldate) DIV 900 having ;
Unfortunately we have lots of callers who calls multiple times when they
are
2011 Apr 11
4
Printing field attributes outside the model.find_by_sql
Hi All,
I have Model called pays..and it has fields like(id, topic, subject,
created_at, b_id) and i also have a Model called suggests with
fields(id, income, price, b_id)
In my ruby on rails action or method Controller:
def print_two_table
@p = Pay.find_by_sql("SELECT p.id, p.topic, s.id, s.income, s.price FROM
pays as P LEFT OUTER JOIN suggests AS s ON s.b_id = p.b_id WHERE
2005 Jul 12
0
Asteriski misses the table
I am not aware what I have done wrong, but the result is a query of:
*Database error:* Invalid SQL: SELECT * FROM WHERE
UNIX_TIMESTAMP(calldate) >= UNIX_TIMESTAMP('2005-07-01') ORDER BY
calldate DESC LIMIT 0,25
*MySQL Error*: 1064 (You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'WHERE
2007 Nov 02
3
Date Issues + Oracle + RoR
Hi Experts
I''ve a product like this
ID -> 1
Name -> Xyz
Price -> 30
Created_at -> 02-NOV-07
from_date = Date.new(2, 10, 07)
to_date = Date.new(2, 10, 07)
@product = Product.find_by_sql("select * from products where
created_at between from_date and to_date")
code works perfectly, buy my issue is i dont get any data. always says
no record found
but if i use
2010 May 07
1
undefined method 'find_by_sql'
Why would I get an undefined method `find_by_sql'' for #Example:
0x981a4e4> for error when trying to use the find_by_sql method in my
model?
def init_dictionaries
tables = find_by_sql( "SHOW TABLES FROM thesaurus" )
@@tables = tables.collect{ |t| t.Tables_in_thesaurus }
end
--
You received this message because you are subscribed to the Google Groups "Ruby
2006 Jan 26
1
Help constructing a find_by_sql command
Hello all. I am trying to do the equivalent of:
@componentlogs = Componentlog.find(:all,
:conditions => [ "cl_compname like ?", @criteria ],
:offset => offset,
:limit => items_per_page,
:order => "cl_spr DESC" )
in a find_by_sql statement. I cannot use the build in because the
adaptor isn''t quite right (OCI8)
When I use it I get the following error
2007 Jul 12
0
No subject
to use the table asterisk.cdr but I can't find it anywhere.
------_=_NextPart_001_01C92A7E.C6B88024
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
2006 Jan 30
1
find_by_sql and memcached
Is a find_by_sql query cached with memcached and cached_model
(http://dev.robotcoop.com/Libraries/)? Looks like the answer is no. Is
there a reason for this? I have a lot of very complicated querys with a
lot of unions, subquerys and joins that would greatly benefit from the
cache.
Going through the code I can see that the find_by_sql method is changed
in cached_model.rb, but it does not call
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql
Order.find_by_sql ([select * from orders where amount > ? and quantity >
?", [ @amount, @quantity ] works;..
but
Order.find_by_sql ([select * from orders where amount > :amount and
quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not
working
a I wrong or should I use a plain select
2008 Jun 23
1
Find_by_sql Doesn't Return Attributes?
My find_by_sql is not returning attributes of the calling model class.
Thermo.find_by_sql("SELECT COUNT(*) FROM thermo WHERE thermo_loc =
''back'' GROUP BY DAYOFWEEK(time_on) ASC")
# ==> [#<Thermo >, #<Thermo >, #<Thermo >, #<Thermo >, #<Thermo >,
#<Thermo >, #<Thermo >]
The sql is fine and when I checked it in a mysql
2006 Jan 31
2
find_by_sql question
I''m no good at SQL and I have a question that will hopefully be fairly
easy to answer.
I''m using acts_as_paranoid which instead of deleting a record adds a
deleted_at column with the datetime the row was deleted. I want to have
a find_by_sql filter out any row where deleted_at is not null.
I have (at least the relevant parts):
#a couple working filters here.
filters <<
2007 Mar 05
1
Using act_as_ferret with find_by_sql
Hello,
I wonder if its possible to combine ferret queries with find_by_sql
queries?
Or should I try to rewrite my query using find and then use
find_by_content when I''m done?
Thanks for a great product!
Regards,
henrik
2006 Apr 20
1
Returning Count from find_by_sql
I want to return an int from a find_by_sql call. But when I use that
result to compare to another count the error tells me I have an array.
MODEL:
# Returns the number of comments in a specified post
def self.find_count(post_id)
find_by_sql(["SELECT COUNT(*) FROM commments WHERE post_id = ?",
post_id])
end
CONTROLLER:
def test
@post =
2006 Jan 10
0
find_by_sql + partials question
Ok now that I have find_by_sql love working for my "Top 10 List" I
want to make them a bit more DRY. Tis is what I have so far:
Model:
def self.topfish
find_by_sql["select species.name,
length,species.multiplier*length as score,caught_on from entries join
species on species_id = species.id where species_id = ? order by
score DESC LIMIT 10", species]
2006 Apr 18
3
Join Queries? - find() or find_by_sql()
Hi All,
Is there a way to do join queries with find() or is it best to use
find_by_sql() instead?
I''m looking to do something like:
SELECT winery_name, wine_name FROM winery, wine
WHERE wine.winery_id = winery.winery_id
AND winery.winery_name LIKE ''Borg%'';
Thanks!
: )
Jason
2007 Aug 14
1
find_by_sql vs connection.select_all
I was trying to do SUM based mySQL query simliar to the following:
SELECT SUM(updated_on - created_on) AS total from signups
If I were to run this command in the mySQL console I would get a
result. However, if I were to run it using the following command in
Rails:
Signup.find_by_sql("SELECT SUM(updated_on - created_on) AS total from
signups")
The query that is written to the log is:
2005 Oct 28
4
find_by_sql column types
Hello--
There must be a better way to do this. I have a class method in my model
that finds averages and does a few calculations using find_by_sql. The
problem I¹m encountering is that all computed columns from MySQL come back
as type string. E.g.,
def self.find_averages(domain_id)
if @@domain_average
return @@domain_average
else
@@domain_average =