error: no match for 'operator*' - qt5

I'm trying to compile KDiff3 in QT5 but I'm stuck on this error, can anyone help?
error: no match for 'operator*' (operand types are 'QAtomicInt' and 'double')
m_pProgressBar->setValue( int( 1000.0 * ( i->m_current * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps + i->m_dRangeMin ) ) );
The error relates to this section of the above: m_current *

operator int() has been removed, try
i->m_current.loadAcquire()

Related

Getting Error related to number format (java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String )

I am having a query as below
select SHIPMENT_COST_SEQNO as SHIPMENT_COST_SEQNO from shipment_cost where shipment_gid = 'A1.53005'
which gives me error as 'java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String '
Though the SHIPMENT_COST_SEQNO is a 5 digit number but still gives me above error.
This works fine with SQL Interface but when i try execute from application it gives me above error .
Any pointers would be appreciable.
Thanks
seems you need casting as your used in entity sting
select cast(SHIPMENT_COST_SEQNO as varchar(50))
as SHIPMENT_COST_SEQNO from shipment_cost where shipment_gid = 'A1.53005'

divide operator error in PostgreSql: operator does not exist: unknown /

I have a Trip table in PostgreSQL DB, there is a column called meta in the table.
A example of meta in one row looks like:
meta = {"runTime": 3922000, "distance": 85132, "duration": 4049000, "fuelUsed": 19.595927498516176}
To select the trip which has largest value divided by "distance" and "runTime", I run query:
select MAX(tp."meta"->>'distance'/tp."meta"->>'runTime') maxkph FROM "Trip" tp
but I get ERROR:
/* ERROR: operator does not exist: unknown / jsonb LINE 1: MAX(tp."meta"->>'distance'/tp."meta"...
I also tried:
select MAX((tp."meta"->>'distance')/(tp."meta"->>'runTime')) maxkph FROM "Trip" tp
but get another ERROR:
/* ERROR: operator does not exist: text / text LINE 1: ...MAX((tp."meta"->>'distance')/(tp."meta...
Could you please help me to solve this problem?
There is not operator div for jsonb values. You have to cast a values on both sizes to some numeric type first:
MAX( ((tp."meta"->>'distance')::numeric) / ((tp."meta"->>'runTime')::numeric) ) maxkph
Try using parentheses:
MAX( (tp."meta"->>'distance') / (tp."meta"->>'runTime') ) as maxkph
Your second problem suggests that these values are stored as strings. So convert them:
MAX( (tp."meta"->>'distance')::numeric / (tp."meta"->>'runTime')::numeric ) as maxkph

Nested select statements in impala sql

I have the following SQL query in impala
SELECT currentdate,close
FROM ( SELECT * FROM spyprice)
Where currentdate between '2015-01-16' and '2016-06-17';
And it is giving me the error:
Starting Impala Shell without Kerberos authentication
ERROR: AnalysisException: Syntax error in line 15:
WHERE currentdate BETWEEN '2015-01-16' and '2016-06-17'
^
Encountered: WHERE
Expected: AS, DEFAULT, IDENTIFIER
CAUSED BY: Exception: Syntax error
Anyone knows what's going on?
Thanks in advance!
#James Xiang The right syntax of the query statement is :
SELECT a.currentdate, a.close FROM
(
SELECT * FROM spyprice
) a
Where a.currentdate between '2015-01-16' and '2016-06-17';

Wrong number of arguments SQL MSACCESS

I am getting an error indicating the wrong number of arguments when I run the following query:
SELECT
population_postcodes.*,
target_postcodes.*,
SQR( EXP(population_postcodes.longitude- target_postcodes.longitude, 2) + EXP(population_postcodes.latitude-target_postcodes.latitude, 2) ) as distance
FROM population_postcodes INNER JOIN target_postcodes on Population_postcodes.Population_postcode = Target_postcodes.Target_postcode;
Could anyone please suggest how I can fix this?
I have also tried the following code:
SELECT Population_postcodes.*, Target_postcodes.*
FROM population_postcodes
INNER JOIN target_postcodes
ON Population_postcodes.Population_postcode = Target_postcodes.Target_postcode
SQR( (population_postcodes.longitude- target_postcodes.longitude)^2 + (population_postcodes.latitude-target_postcodes.latitude)^2 ) as distance;
And this code:
SELECT Population_postcodes.*, Target_postcodes.*, SQR( (population_postcodes.longitude- target_postcodes.longitude)^2 + (population_postcodes.latitude-target_postcodes.latitude)^2 ) as distance
FROM population_postcodes
INNER JOIN target_postcodes
ON Population_postcodes.Population_postcode = Target_postcodes.Target_postcode;
Exp needs one parameter, you give two.
Old: EXP(population_postcodes.longitude- target_postcodes.longitude, 2)
New: (population_postcodes.longitude- target_postcodes.longitude)*(population_postcodes.longitude- target_postcodes.longitude)
Try replacing...
EXP(<expression>, 2)
...to...
<expression>^2
In Access, the EXP function returns e (the base of natural logarithms) raised to a power. To raise an expression to a power, use the ^ operator.
In your case, be careful to put brackets around the expression, for example...
(population_postcodes.longitude- target_postcodes.longitude)^2
...to force the power to be applied last. By default, the ^ operator is evaluated before the - operator.

Oracle error using "in"

Why do I have an error in this query?
My request:
SELECT * FROM CURVES c WHERE c.TYPE_CURVES in ({0}, {10}, {20}, {30})
Error:
ORA-00911 invalid character
Because it should read:
SELECT * FROM CURVES c WHERE c.TYPE_CURVES in (0)
This is a good site for understanding it.
EDIT
Adding multiple pieces of data...
SELECT * FROM CURVES c WHERE c.TYPE_CURVES in (0,20,30,40)
Or as strings...
SELECT * FROM CURVES c WHERE c.TYPE_CURVES in ('0','20','30','40')