firebird

php: how to prevent SQL injection from $_POST

坚强是说给别人听的谎言 提交于 2019-12-11 05:24:53
问题 i have some php script and i think this have a lot of mistake. because of my limited knowledge in concatenation and SQL injection. At 1st time i'm not have any trouble because this script use PHP-Mysql. But after i try to change into Interbase, i meet a lot of trouble. Please help to identify my fault. this my following query: $sLimit = ""; if ( isset( $_POST['iDisplayStart'] ) ) { $sLimit = " FIRST ".$_POST['iDisplayStart']." SKIP ".$_POST['iDisplayLength']; } $sOrder =""; $sOrder = " ORDER

Recursive Relationship on Dictionary Table

青春壹個敷衍的年華 提交于 2019-12-11 03:42:21
问题 I'm working on a poor, but ok for us , full-text search using only PSQL in Firebird. I'll try to simplify as much as possible by focusing on my problem: Summing up, this a dictionary table: SELECT * FROM FTS_KEYWORDS ID | KEYWORD ----+----------- 1 | 'FORD' 1 | 'MUSTANG' 1 | '2010' 2 | 'FORD' 2 | 'FUSION' 2 | 'TURBO' 2 | '2010' 3 | 'FORD' 3 | 'RANGER' 3 | 'TURBO' 3 | '2010' 3 | 'BLACK' There is too a FTS_TOKENIZE() procedure to get the words from the whole strings Case 1: User search with 1

unknown value <Buffer d2 f3 f0 e0 e5 e2 e0 20> when select from firebird in Node.js

拈花ヽ惹草 提交于 2019-12-11 03:35:11
问题 I'm new at firebird. I am trying to fetch the name from DB, but it returns: <Buffer d2 f3 f0 e0 e5 e2 e0 20> What does it mean? How to convert it to readable characters? Thanks in advance db.query('SELECT FIRST 10 * FROM client', function(err, result) { // IMPORTANT: close the connection console.log(result[0].name) db.detach(); }); 回答1: It is a Buffer object (NodeJS docu), which is the usual return value for data, whose type is not predetermined. To convert it to a string again, use its

Setting up a second TFDPhysFBDriverLink - possible and necessary?

感情迁移 提交于 2019-12-11 02:36:27
问题 My application has a design time TFDConnection and TFDPhysFBDriverLink as source connection. This may or may not be opened in Firebird embedded mode (if so, FDPhysFBDriverLink.VendorLib := 'fbembed.dll' is set (32 bits)). I create a run-time target TFDConnection which must use embedded Firebird because we do not know if Firebird is installed on the PC (our setup supplies fbembed.dll ). How do I set this up? At runtime I can create another TFDPhysFBDriverLink and set its VendorLib, but how

How to execute procedure returning resultset in Firebird

最后都变了- 提交于 2019-12-11 02:23:23
问题 I have the following table create table LIST_PIPE_TABLE ( ID INT, ITEM VARCHAR(4000), IS_FOLDER VARCHAR(10) ) with 3 rows of data insert into LIST_PIPE_TABLE values(1,'Victorias Secret','true') insert into LIST_PIPE_TABLE values(2,'Porsche','true') insert into LIST_PIPE_TABLE values(3,'Babbolat','false') And a stored procedure that should return resultset CREATE or alter PROCEDURE LIST_PIPE RETURNS ( col1 varchar(4000), col2 varchar(10) ) AS begin FOR SELECT ITEM AS ITEM ,IS_FOLDER AS IS

Entity Framework Code First Migrations and Firebird

痴心易碎 提交于 2019-12-11 01:48:16
问题 I'm trying to enable migrations on a Firebird 2.5 database. I'm using VS2015 and the ADO Driver and Entity Provider are installed and working correctly. I reverse engineered the database, made the necessary changes to make it work. I can do the enable-migrations on the Package Manager Console, and add a migration. When I do update-database this happens: PM> update-database Specify the '-Verbose' flag to view the SQL statements being applied to the target database. Applying explicit migrations

NHibernate use Firebird own generator

≯℡__Kan透↙ 提交于 2019-12-11 01:47:12
问题 Having own generator in Firebird DB called GEN_PATIENT_ID I would like to leave the generation of ID on the DB side instead of NHibernate and FluentNHibernate. Following this link I am overriding the default Fluent behavior like this: public class PatientOverride : IAutoMappingOverride<Patient> { public void Override(AutoMapping<Patient> mapping) { mapping.Cache.ReadOnly().Region("LongTermReadWrite"); mapping.Id(x => x.Id).GeneratedBy.Sequence("GEN_PATIENT_ID"); mapping.HasOne(patient =>

Why does Firebird 2.5.8 return NONE on SELECT CURRENT_ROLE?

落爺英雄遲暮 提交于 2019-12-11 00:31:03
问题 Following on from my question here How to REVOKE ROLE GRANTED BY another user on Firebird 2.5.8? and @Arioch's helpful suggestion to query what ROLE is actually connected prior to the command. SELECT CURRENT_ROLE FROM RDB$DATABASE Now despite my connection string explicitly using "ROLE=RDB$ADMIN", checking in gsec that the given user has admin option, when I run the command the result is NONE. This was using the Firebird ADO.NET FirebirdSql.Data.FirebirdClient interface v6.6. So I performed a

Firebird Create a View with Cyrillic Letters in WHERE Clause

偶尔善良 提交于 2019-12-10 23:23:50
问题 in FireRobin, I'm trying to create a View that contains Cyrillic letters in it: CREATE VIEW "CyrillicView" (PRIM) AS SELECT PRIM FROM ROYALTY WHERE (ROYALTY.PRIM = 'Кириллица'); Unfortunately, it results in the Error: Message: isc_dsql_execute2 failed SQL Message : -607 This operation is not defined for system tables. Engine Code : 335544351 Engine Message : unsuccessful metadata update STORE RDB$RELATIONS failed Malformed string When I replace Cyrillic letters with latin ones everything

Insert null into not null column with default FIREBIRD

三世轮回 提交于 2019-12-10 21:52:45
问题 Inserting null into not null column with default is giving me a validation error instead of taking the default value. I don't want to make on before triggers to all of the tables. Is there any other way to do this? Firebird 2.1.3 回答1: The default value is used when you omit a field in the insert, not when you include the field with a null value. Example: Uses default for Name : insert into SomeTable (Id) values (42) Tries to insert null into Name : insert into SomeTable (Id, Name) values (42,