[firebird-support] FB 3.0, Dialect 1 and SQL Error

2016-05-20 Thread michael.vilhelm...@microcom.dk [firebird-support]
Hi

I have installed Firebird 3.0. I'm testing our program up against this one. 
Our databases are in SQL dialect 1.

I have a table like this:

CREATE TABLE MYTABLE 
(
  ID  INTEGER NOT NULL,
  NAME_   VARCHAR(30),
  VALUEFLOAT  NUMERIC( 18, 2) DEFAULT 0,
  VALUEINTINTEGER DEFAULT 0,
  AAR INTEGER DEFAULT 0,
  MDR INTEGER DEFAULT 0,
 CONSTRAINT PK_MYTABLE PRIMARY KEY (ID)
);


If I do this SQL, I get an error:

SELECT
  MYTABLE.NAME_,
  Sum(MYTABLE.VALUEFLOAT) AS SumFloat,
  Sum(MYTABLE.VALUEINT) AS SumInteger
FROM
  MYTABLE
WHERE
  ((MYTABLE.AAR * 100) + MYTABLE.MDR) >= ((:PAar * 100) + :PMDR)
GROUP BY
  NAME_
  

ERROR:
Dynamic SQL Error expression evaluation not supported Invalid data type for 
multiplication in dialect 1

 It works if I replace the parameters with numbers like this:
 

 SELECT
  MYTABLE.NAME_,
  Sum(MYTABLE.VALUEFLOAT) AS SumFloat,
  Sum(MYTABLE.VALUEINT) AS SumInteger
FROM
  MYTABLE
WHERE
  ((MYTABLE.AAR * 100) + MYTABLE.MDR) >= ((2016 * 100) + 5)
GROUP BY
  NAME_
  

 

 

 So my question is, if there is a simple workaround to avoid this?
 I have tried googling something on this, but havn't found anything so far.
 I have read the release notes, but either cant find anything on this or I'm 
not looking good enough.
 

 Michael

 



Re: [firebird-support] accessing firebird on windows from linux

2016-05-20 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 17-5-2016 16:43, robert rottermann rob...@redcor.ch 
[firebird-support] wrote:
> Hi there,
>
> I try to access a firebird db on windows from my ubuntu box.
> I have a gui-tool (FlameRobin), from which this works nicely. Therefore
> it is not a firewall or access problem.
>
> Now I would like to do it using python and sqlalchemy.
> So far I failed..
>
> This is the connection string I use:
> engine =
> sa.create_engine('firebird+fdb://SYSDBA:thekey@10.42.1.150:3050///c:\\Users\\elvis\\Documents\\VAS.fdb')
>
> I tried many combinations of the part after the port.

I think you have too many `/` after the port number. Try

sa.create_engine('firebird+fdb://SYSDBA:thekey@10.42.1.150:3050/c:\\Users\\elvis\\Documents\\VAS.fdb')

It would also be very helpful to post the error message you get when 
doing this.

Mark
-- 
Mark Rotteveel


Re: [firebird-support] accessing firebird on windows from linux

2016-05-20 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 20-5-2016 13:21, Mark Rotteveel m...@lawinegevaar.nl 
[firebird-support] wrote:
> I think you have too many `/` after the port number. Try
>
> sa.create_engine('firebird+fdb://SYSDBA:thekey@10.42.1.150:3050/c:\\Users\\elvis\\Documents\\VAS.fdb')
>
> It would also be very helpful to post the error message you get when
> doing this.

Also note that the Firebird server is very likely not able to access 
files in a user folder, as those are only accessible by that user, and 
not by the user running the Firebird service (unless Firebird is running 
as user elvis).

Mark
-- 
Mark Rotteveel


Re: [firebird-support] FB 3.0, Dialect 1 and SQL Error

2016-05-20 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
Have you tried

(cast(:PAar as integer) * 100) + cast(:PMDR as integer))

I've never tried it the exact setting as you're using, but I've had to use
cast when I've used a CTE to return a constant value (quite natural,
there's no simple and general way for Firebird to guess what type your
parameter is).

2016-05-20 12:59 GMT+02:00 michael.vilhelm...@microcom.dk
[firebird-support] :

>
>
> Hi
>
> I have installed Firebird 3.0. I'm testing our program up against this
> one.
> Our databases are in SQL dialect 1.
>
> I have a table like this:
>
> CREATE TABLE MYTABLE
> (
>   ID  INTEGER NOT NULL,
>   NAME_   VARCHAR(30),
>   VALUEFLOAT  NUMERIC( 18, 2) DEFAULT 0,
>   VALUEINTINTEGER DEFAULT 0,
>   AAR INTEGER DEFAULT 0,
>   MDR INTEGER DEFAULT 0,
>  CONSTRAINT PK_MYTABLE PRIMARY KEY (ID)
> );
>
>
> If I do this SQL, I get an error:
>
> SELECT
>   MYTABLE.NAME_,
>   Sum(MYTABLE.VALUEFLOAT) AS SumFloat,
>   Sum(MYTABLE.VALUEINT) AS SumInteger
> FROM
>   MYTABLE
> WHERE
>   ((MYTABLE.AAR * 100) + MYTABLE.MDR) >= ((:PAar * 100) + :PMDR)
> GROUP BY
>   NAME_
>
>
> ERROR:
> Dynamic SQL Error expression evaluation not supported Invalid data type
> for multiplication in dialect 1
>
> It works if I replace the parameters with numbers like this:
>
>
> SELECT
>   MYTABLE.NAME_,
>   Sum(MYTABLE.VALUEFLOAT) AS SumFloat,
>   Sum(MYTABLE.VALUEINT) AS SumInteger
> FROM
>   MYTABLE
> WHERE
>   ((MYTABLE.AAR * 100) + MYTABLE.MDR) >= ((2016 * 100) + 5)
> GROUP BY
>   NAME_
>
>
>
>
> So my question is, if there is a simple workaround to avoid this?
>
> I have tried googling something on this, but havn't found anything so far.
>
> I have read the release notes, but either cant find anything on this or
> I'm not looking good enough.
>
>
> Michael
>
>
>
>
> 
>


Re: [firebird-support] FB 3.0, Dialect 1 and SQL Error

2016-05-20 Thread michael.vilhelm...@microcom.dk [firebird-support]
Of course Firebird didn't know. 

And it seems to work.

Thank you

[firebird-support] Re: Merge in Fb3 fails

2016-05-20 Thread kyle...@yahoo.com [firebird-support]
Thank you both for your answers, both merges work!

Kyle

[firebird-support] Grant role by script

2016-05-20 Thread kyle...@yahoo.com [firebird-support]
Hello,
 

 Using FlameRobin, I can run this statement

 GRANT rdb$admin TO USER MyUser;

However, I can't seem to run it in a script. I have a master script file that 
runs a set of files. I tried it in a file, and directly

1) %SqlExe% -user '%Usr%' -password '%Pwd%' -input ..\Tables\aaaGrant.sql -echo 
-output %OutFile%


2) %SqlExe% -user %Usr% -password %Pwd%  GRANT rdb$admin TO USER LegacyUser;

 Is there a way to do this by script?
 

 Thanks



[firebird-support] Stored Procedures Execution Plan

2016-05-20 Thread joao_paul...@yahoo.com [firebird-support]
Hi.
 

 

 I would like to know if it is possible to display the plan of stored procedure 
statements.
 

 I'm interested in the plan of the statements inside the stored procedure (SP), 
not the plan just informing that I'm executing an SP.
 

 We are running also selectable SP's.
 

 Att.
 
 João Paulo