Re: [firebird-support] Firebird 4 and RDB$ERROR

2019-05-16 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
Am 16.05.19 um 10:49 schrieb sbai...@mutualconsultants.ltd.uk 
[firebird-support]:
>
> Maybe this question is also off-topic, but can you tell me which group 
> I should use for posting questions about FB4 Beta 1?

This would be

https://lists.sourceforge.net/lists/listinfo/firebird-devel

hth

fsg



Re: [firebird-support] re: Can't get Firbird 3.x embedded to work in Delphi 10.3 update 1?

2019-04-24 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
Am 24.04.19 um 15:52 schrieb 'Chris LeFebvre' lefebv...@comcast.net 
[firebird-support]:



I’ve gone over the three responses by liviuslivius, Dimitry Sibiryakov 
and Frank_Schlottmann-G=c3=b6dde.


I must have misunderstood something in the documentation so I switched 
the VendorLib in the TFDPhysFBDriverLink back to fbclient.dll.


Liviuslivius: In FDConnection1 settings are the same as what you 
describe, I checked and by default the providers line was commented 
out in firebird.conf and I edited it to only be ”Providers = Engine12”


Frank_Schlottmann: I also followed your directions but the version 3 
dll’s are the same name but they have 52 instead of 62.


One thing, my application is 64bit and I do have the 64bit 
fbclient.dll in the Debug / application so can you connect to an 
embedded database at design time by checking the Connected property of 
the TFDConnection component? I remember reading somewhere that during 
design time that since the IDE is 32bit that in certain instances 
there may be a bitness problem between design time and run time? But 
regardless of if it’s designed time or run time I still get “Database 
unavailable”?




You could try to use sth. like:
[FB40]
; FB40 virtual driver will use specified Firebird client library
BaseDriverID=FB
VendorLibWin32=C:\Program Files\Firebird\Firebird_4_0\WOW64\fbclient.dll
VendorLibWin64=C:\Program Files\Firebird\Firebird_4_0\fbclient.dll

in your fddrivers.ini.

The ide needs a 32-bit-Version.

http://docwiki.embarcadero.com/RADStudio/Rio/en/Configuring_Drivers_(FireDAC)



mit freundlichen Grüßen
Frank Schlottmann-Gödde



Re: [firebird-support] GPRE

2019-02-20 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
ileRequest(fbStatus, 
sizeof(fb_0), fb_0);
   isc_vtov ((const char*) rf->relation, (char*) fb_1.fb_2, 
1009);
   isc_vtov ((const char*) rf->field, (char*) fb_1.fb_3, 1009);
   if (req_handle3)
   req_handle3->startAndSend(fbStatus, fbTrans, 0, 
0, 2018, CAST_CONST_MSG(_1));
if (fbStatus->getErrors()[1] == isc_bad_req_handle) 
{ req_handle3->release(); req_handle3 = NULL; }
   else break;
   }
if (!(fbStatus->getState() & Firebird::IStatus::STATE_ERRORS)) {
while (1)
   {
req_handle3->receive (fbStatus, 0, 1, 2, 
CAST_MSG(_4));
   if (!fb_4.fb_5 || (fbStatus->getState() & 
Firebird::IStatus::STATE_ERRORS)) break;
if (tdgbl->runtimeODS < rf->ods_version)
tdgbl->runtimeODS = rf->ods_version;
/*END_FOR;*/
   }
   };
/*ON_ERROR*/
if (fbStatus->getState() & Firebird::IStatus::STATE_ERRORS)
   {
general_on_error();
/*END_ERROR;*/
   }
}
}
MISC_release_request_silent(req_handle3);
}

namespace
{
// copy/paste from backup.epp
void general_on_error()
{
/**
 *
 *  g e n e r a l _ o n _ e r r o r
 *
 **
 *
 * Functional description
 *  Handle any general ON_ERROR clause during ODS level detection.
 *
 ******/
BurpGlobals* tdgbl = BurpGlobals::getSpecific();

BURP_print_status(true, isc_status);
BURP_abort();
}
}



On 13.02.19 17:39, Robert Tulloch tult...@hughes.net [firebird-support] 
wrote:
> 
> 
> Anyone have an example of embedded SQL code and the GPRE result?
> 
> Thanks
> 
> Best regards
> 
> 
> 

mit freundlichen Grüßen
Frank Schlottmann-Gödde

-- 
Oldenburger Str. 34, 23743 Grömitz, Tel.: 04562/266984



Re: [firebird-support] Unit testing for stored procedures?

2014-12-06 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
On 05.12.2014 17:19, Tim Ward t...@telensa.com [firebird-support] wrote:
 Anyone done any of this?

 Testing a stored procedure involves

 - set up test data
 - run the procedure
 - check and report on results
 - any clean up needed (remove or restore output data, reset generators,
 ect ect)

 and setting this all up is somewhat non-trivial, but then so is manually
 checking the results of a procedure which can do quite complicated
 things to a dozen or more tables.

 So it would be nice to have a framework into which we could just drop
 a few scripts describing the input data, the expected output data, and
 the procedure(/query/script/whatever) to run. Does such a thing exist?


You may want to take a look at 
http://svn.code.sf.net/p/firebird/code/qa/fbtest/trunk/

It's a testing framework written in python, it contains also Delphi 
source code for a test editing gui.

hth
fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads, 
their tears have healing powers and they make highly faithful pets. - 
J.K. Rowling



[Non-text portions of this message have been removed]



Re: [firebird-support] Compile Firebird-2.5.3 with Ptxdist for ARM

2014-10-02 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
On 01.10.2014 14:28, Mathias Stucki mathias.stu...@fasnacht.biz 
[firebird-support] wrote:


 Hello,

 I am trying to compile Firebird-2.5.3 with ptxdist-2014.09.0, using
 OSELAS.Toolchain-2013.12.2.

 Unfortunately I’m getting a lot of compile errors:

Well, the build process for FB2.5 isn't fit for cross-compiling.

You may either create a build environment on your embedded system or use 
qemu to create an emulation and build it there.

A short tutorial (in german language for a raspberry pi) can be found here:

http://www.forum-raspberrypi.de/Thread-firebird-sql-server-compilieren

hth

Frank

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] anywhere we can do a showcase of firebird projects?

2014-08-05 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
Am 04.08.2014 17:51, schrieb g80r...@gmail.com [firebird-support]:


 I just wonder.


What about:

http://www.firebirdsql.org/en/case-studies/

hth

Frank

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] Blob write to Embedded on Linux performance

2014-06-09 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
On 09.06.2014 15:51, Mike Ro miker...@gmail.com [firebird-support] wrote:

 So the only mystery (for me!) remaining is why the UDF is so much faster
 when it is writing 4096 bytes at time with forced writes on?

Usually it is faster to let the server do the dirty work, but I'm not 
sure that it is the only reason here.

Anyway, it seems that your problem is solved at least for now.

fsg


Re: [firebird-support] Blob write to Embedded on Linux performance

2014-06-07 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
On 06.06.2014 15:11, Mike Ro miker...@gmail.com [firebird-support] wrote:

 Frank, thank you for taking the time to do this. It confirms that there is 
 definitely something wrong with my setup (are you using Firebird version 
 2.5.2?).

No, its LI-T3.0.0.31151 Firebird 3.0 Alpha 2, but that should not matter

 Could you also share your table definition, especially what indexes or
 constraints you have defined as I wonder if this is causing the
 exception? Also do you have anything special in your firebird.conf?
 .ddd,_._,___


Nothing special here, it only contains raw weather data, I just added 
the blob reading UDF for testing.

This is probably the cause of the exception:

 declare external function f_insertblob cstring (20), blob returns int by
 value entry_point 'insertblob' module_name 'test_udf.so';

should be

DECLARE EXTERNAL FUNCTION f_insertblob CSTRING(255),  BLOB RETURNS 
PARAMETER 2
entry_point 'insertblob' module_name 'test_udf.so'


The function expects to get a blobcallback structure from the server, 
returns parameter 2 lets the engine provide it.


Frank


Re: [firebird-support] Blob write to Embedded on Linux performance

2014-06-06 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
On 04.06.2014 00:08, Mike Ro miker...@gmail.com [firebird-support] wrote:

 Unfortunately I haven't had any success in trying this because
 blob_put_segment() is causing Firebird embedded to throw an instance of
 Firebird::status_exception followed by a core dump that I really can't
 get to the bottom of. All the other blob functions work fine (such as
 blob_get_segment) and return correct results.

Ok, this is what I get for a 13MB file on an Intel NUC (Celeron), 
database and home are on an USB Drive, so no real good hardware.


SQL set stat;
SQL set time;
SQL select b_loadfromfile('/home/frank/w.mp3') from rdb$database;

B_LOADFROMFILE
=
   0:1
==
B_LOADFROMFILE:
BLOB display set to subtype 1. This BLOB: subtype = 0
==

Current memory = 3784
Delta memory = 416616
Max memory = 37899608
Elapsed time= 9.423 sec
Cpu = 0.000 sec
Buffers = 2048
Reads = 0
Writes = 830
Fetches = 1767

I could send you my udf if you want to test it.

Frank


Re: [firebird-support] Blob write to Embedded on Linux performance

2014-06-02 Thread Frank Schlottmann-Gödde fr...@schlottmann-goedde.de [firebird-support]
Am 28.05.2014 11:38, schrieb Mike Ro miker...@gmail.com [firebird-support]:
 
 
 I am sorry to bump this, but has anyone else got experience of using
 blobs on Linux?

Yes, of course,  but I never felt the need to time the operations, we
are using a udf s.th. like:

void EXPORT fn_b_load (  char*  s ,  BLOB b  )
{
  unsigned char *buffer;
  if ( b-blob_handle )
  {
int buffsize = 4096;
FILE *file;
unsigned char *fname = intern_recode(s);
file= fopen ( fname, rb );
if ( file )
{
  buffer= ( unsigned char * ) malloc ( buffsize );
  if ( buffer )
  {
int readSize;
for ( ;; )
{
  readSize = fread ( buffer,1,buffsize, file );
  ( *b-blob_put_segment ) ( b-blob_handle, buffer,readSize );
  if ( readSize != buffsize )
break;
}
free ( buffer );
  }
  fclose ( file );
}
free( fname);
  }
}


to load documents into the database.


I will try to find the time to check thiswith some big mp3's.

fsg


-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Request for advice

2014-04-24 Thread Frank Schlottmann-Gödde
On 04/24/2014 01:32 PM, Mags Phangisa wrote:


 Thanks Thomas. Blobs are seldom accessed.


As a compromise, I would suggest to place your blobs into a separate 
table, it will increase the size of your main database, but will also 
speed up the acccess to your blobs without interfering with everyday 
database operations.

hth
fsg
-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] An unhandled exception of type 'System.NotSupportedException' occurred in FirebirdSql.Data.FirebirdClient.dll

2014-02-10 Thread Frank Schlottmann-Gödde
Am 10.02.2014 08:31, schrieb nkd...@gmail.com:
 
 
 I am creating a project windows runtime component with c# , I want to
 create a embedded DB so i am using Firebird-2.5.2.26540-0_x64_embed
 and .net provider NETProvider-2.5.2-CF .
 
 every time i am getting same error:  An unhandled exception of type
 'System.NotSupportedException' occurred in
 FirebirdSql.Data.FirebirdClient.dll .
 
 my project is not targeted to any .net framework because it is only
 WinRT( c# )...
 
 Please help me guys..please reply


You probably will get more answers here:

https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

hth
fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Firebird client error ibxeUnknown

2013-08-18 Thread Frank Schlottmann-Gödde
On 17.08.2013 16:06, Wolfgang Kluge wrote:
 Good evening.

 I will greatly appreciate if somebody could help me with this.

 The Delphi 5 source code:

 procedure T_main.LoadForm( FormClass: TFormClass; FormName: String; Splash: 
 Boolean );
 var
 ChildForm : TForm;
 nReturn   : Integer;
 begin
 bReturnFromSub  := True;
 ChildForm := FormClass.Create( self );
 nReturn   := ChildForm.ShowModal;
 ChildForm.Free;
 Repaint;
 if ( nReturn = 3 ) then Logout1Click( Nil );
 end;

 Procedure is called by   LoadForm(T_Rooms,'_Rooms', False );


 The call ShowModal throws the error ibxeUnknown.

 Only one out of 11 calls in my database application misbehaves and I simply 
 have
 run out of ideas of how to handle this.

If you could show us the code for T_rooms, may be someone will be able 
to help.

fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling



Re: [firebird-support] Python FDB 1.4 not returning the first record

2013-08-16 Thread Frank Schlottmann-Gödde
On 16.08.2013 11:50, greatdaydan wrote:
 I have just started using Python and have discovered FDB. Super-duper! Now I 
 can create a web interface for one of my applications.

 I am using the FDB 1.4 documentation to learn how to use FDB.

 A 'select * from table' returns all but the first record.

 A 'select * from table where id = x' returns an empty [].

 A 'select * from table where id  4' returns [(2,),(3,)].

 I created a db  table using FDB then inserted some data. The 'selects' 
 return the correct data.

 Can someone explain why this is happening?



Probably you will get more answers for Python related questions at

firebird-pyt...@yahoogroups.com


hth
fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support]

2013-05-03 Thread Frank Schlottmann-Gödde
Am 30.04.2013 14:18, schrieb Lepage, Pierre:
 Hi,

 We are using Firebird Client 1.0 on one or a lot of computers in the
 company.

 Actually, we analyze the situation because we plan to migrate every
 computers in the company from Windows XP to Windows7 64bits.

 We need to know if Firebird Client 1.0 will run under Win7 64bits or
 if we need to download Firebird 2.5.

I haven't tried it, but it should run. Although, if you want to convert
your client programs to 64bits you will need to use a 2.5 64bit
fbclient.dll.

 I need to be sure that Firebird 2.5 is an upgrade of Firebird Client
 1.0 because it's not mention on your website.

The 2.5 fbclient.dll is a bit more than an upgrade and should be able to
connect to ancient Fb 1.0 installations

 Could you confirm all of that to me?

Well, a real confirmation will need a test with your client programs and
your servers. I haven't seen a 1.0 installation for about ten years.

hth
Frank

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] Delphi XE2. Migrating from IBX components

2013-03-25 Thread Frank Schlottmann-Gödde
Am 08.03.2013 16:52, schrieb Sergio:
 Hello I have all my apps in Delphi with the IBX components and
 ClientDataSets to conect with a FB Database. Since long time ago IBX
 creator says it doesn't support FB. So far I can work with very
 simple queries fine. But now I'd like to use a component which
 supports FB.

 I'd like to hear some opinions regarding what component to use in
 Delphi. Is there any free one?  Thanks in advance!

A bit late, but here are my 2 ct:

If you are working on a non profit project (or earning money with it)
ibobjects would be a good choice,

Ibdac from devart are quite good also.

If you prefer an open source alternative, unified interbase would do the 
job.

I personally don't like this dbx stuff (I prefer a slim interface to the 
database api), but your mileage may vary.


mfg
fsg


Re: [firebird-support] Delphi XE2. Migrating from IBX components

2013-03-25 Thread Frank Schlottmann-Gödde
Am 25.03.2013 22:49, schrieb Frank Schlottmann-Gödde:
 Am 08.03.2013 16:52, schrieb Sergio:
 Hello I have all my apps in Delphi with the IBX components and
 ClientDataSets to conect with a FB Database. Since long time ago IBX
 creator says it doesn't support FB. So far I can work with very
 simple queries fine. But now I'd like to use a component which
 supports FB.

 I'd like to hear some opinions regarding what component to use in
 Delphi. Is there any free one?  Thanks in advance!
Sorry, forgot FibPlus, another good component.

They all provide demo versions, so you can decide yourself.


hth

fsg


Re: [firebird-support] Authentication = Trusted, where to learn more

2012-12-02 Thread Frank Schlottmann-Gödde
On 11/30/2012 10:47 AM, Brian Dunstan wrote:
 Hi,

 Where can I learn about using trusted authentication?

 Thanks in advance,
 Brian

Firebird release notes:
http://firebirdsql.org/rlsnotesh/rlsnotes210.html#rnfb210-wintrusted

hth
Frank
-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] Learning Curve

2012-11-08 Thread Frank Schlottmann-Gödde
On 11/08/2012 07:20 PM, Marsha wrote:
 Hi all,

 Can anyone recommend some introductory tutorials, online courses,
 and/or prerequisite information I need to learn before diving into
 Firebird?

http://www.firebirdfaq.org/faq324/
is a good starting point
and if all else fails
http://www.ib-aid.com/downloads/#fbfirstaid
may be an option.

hth
Frank
-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] Slow query with like '%xxx%' clause

2012-07-13 Thread Frank Schlottmann-Gödde
On 13.07.2012 14:22, Tupy... nambá wrote:
 Wenn man die Vorschlage aus Herrn Gödde folgen wird, man kann ein
 Googler bauen. d.h., wenn man insert oder update macht,
 dann eine Tabelle mit Suchwörte und Index wird aktualiziert..
 stimmt das ?

Genau, but don't forget the delete :-)

If this kind of search is needed quite often and search speed is an
issue, it is the easiest solution I can think of. Another approach could
be to add a somehow normalized representation of the data

(removing stop-words from customer names, remove letters from VAT-Codes
etc.)

 This can mean that the accessories operations will increase
 the time to insert/update operations. 

The impact is not that big from my experience.
We use a similar approach to allow a global search over lot's of
different tables.


fsg
-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling



Re: [firebird-support] Reference manual in on place

2012-07-12 Thread Frank Schlottmann-Gödde
On 07/12/2012 06:17 PM, K Z wrote:
 Hello,


 Does anyone knows where i can find a full reference manual of the
 FB2.5?

 For example, i tried to search the command SOUNDEX in the FB site and
 inside the documents mentioned at
 http://www.firebirdsql.org/en/reference-manuals/ (Reference Manuals
 and the InterBase 6.0 Manuals Language Reference) without any
 success.

There are some soundex UDF's out there, but they won't help you.

They just flatten the difference between e.g. Myer, Maier, Meyer etc. 
but they will not help you searching  'Dr. Meyer LTD'

fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling




Re: [firebird-support] The data is not displayed correctly using UTF8

2012-02-24 Thread Frank Schlottmann-Gödde
On 23.02.2012 19:23, Sergio Garcia wrote:
 Hi. We created a DB with UTF8 as Default character set (SS v2.5.1.26351). In
 FlameRobin we see the data correctly (Canadá), however from the Delphi (v6),
 using native controls at palette Interbase, the data is not displayed
 correctly (Canadá). 

IBX-Components explicitly don't support Firebird (a decision of Jeff
Overcash).

This may help:
http://translate.google.com/translate?hl=ensl=rutl=enu=http://www.ibase.ru/unicode_faq.html%23divzero


http://qc.embarcadero.com/wc/qcmain.aspx?d=69856


fsg
-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Re: Precompiling with gpre and Firebird 2,5

2012-01-03 Thread Frank Schlottmann-Gödde
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 31/12/11 16:18, cartonace wrote:

 Hello Frank
 
 Thanks for the swift reply but the environment variables were/are
 already set and it still prompted me for a user name and password.  I
 think the security has been beefed up somewhere between 1.5 and 2.5
 
 Thanks for the suggestion though.

Maybe you can get an answer in the developers group

https://lists.sourceforge.net/lists/listinfo/firebird-devel

providing some more details about what you did so far.

hth
fsg

- -- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
 their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8CukAACgkQn6XCniU5U8J+fgCeN4ggShcFRwFr7tqo0BG+Jzmb
ZJkAnR4RwqCPfGK/2w6r6UrAIWSubcSJ
=BjHp
-END PGP SIGNATURE-


Re: [firebird-support] Precompiling with gpre and Firebird 2,5

2011-12-31 Thread Frank Schlottmann-Gödde
On 30.12.2011 13:39, cartonace wrote:
 I am trying to migrate to 2.5 from 1.5. I am updating a c program that writes 
 data to a table.  When I try to run the program I get the following error:
 
 Your user name and password are not defined. Ask your database administrator 
 to set up a Firebird login.
 
 When I supply a user name and password in the database connection statement 
 and try to recompile, I get the following warning:
 
 gpre: -user, -password and -charset switches require -manual
 
 But I don't want to use the -manual option because I want to work with 
 automatic transactions as I did with Firebird 1.5.
 
 Does anybody know a way around this?


Not shure whether it will help in this case, but did you try setting
ISC_USER and ISC_PASSWORD environment variables?

hth
fsg

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Re: selecting a field by name (using a var)

2011-11-07 Thread Frank Schlottmann-Gödde
Am 07.11.2011 16:27, schrieb Tomasz Tyrakowski:
 Hi,
 
 One small improvement.
 
 Instead of
 
 execute statement :loc_sql into :out_fecha;
 
 I'd recommend
 
 for execute statement :loc_sql into :out_fecha do suspend;
and additional take a look at
http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes251.html#rnfb25-psql-dynex


hth

Frank


Re: [firebird-support] Re: Firebird 2.5 crashing after calling UDF

2011-11-04 Thread Frank Schlottmann-Gödde
Am 26.10.2011 02:49, schrieb sir_wally_lewis:
the same unaltered code works under CenTos 64 bit in 2.1 though.
 
 Still do not understand why my freepascal UDF is crashing.

I have added an issue to the tracker
http://tracker.firebirdsql.org/browse/CORE-3651

cheers
FSG

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Re: Firebird 2.5 crashing after calling UDF

2011-11-01 Thread Frank Schlottmann-Gödde
On 26.10.2011 02:49, sir_wally_lewis wrote:
 Thanks for the fixes to my C library Tomasz and for your help.
 
 All my C Library is originally extracted from FreeUDFLibC and I added extra 
 functions.
 
 There were errors in the C Code that I was unaware of.
 
 Amazing that the same unaltered code works under CenTos 64 bit in 2.1 though.
 
 Still do not understand why my freepascal UDF is crashing.

Appears to be another bug similar to

http://tracker.firebirdsql.org/browse/CORE-3646

Even simple ppc64 generated udfs triggers the fb server process to end
on disconnecting the client.

I will create a simplified testcase and add it to the tracker asap.



mit freundlichen Grüßen
Frank Schlottmann-Gödde

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Re: Firebird 2.5 crashing after calling UDF

2011-10-26 Thread Frank Schlottmann-Gödde
On 26.10.2011 02:49, sir_wally_lewis wrote:
 Thanks for the fixes to my C library Tomasz and for your help.
 
 All my C Library is originally extracted from FreeUDFLibC and I added extra 
 functions.
 
 There were errors in the C Code that I was unaware of.
 
 Amazing that the same unaltered code works under CenTos 64 bit in 2.1 though.
 
 Still do not understand why my freepascal UDF is crashing.

If it's not too much code, I could check them if you want.


Frank


-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets.
  - J.K. Rowling


Re: [firebird-support] Re: Pascal UDF passing timestamps/strings

2011-10-11 Thread Frank Schlottmann-Gödde
On 11.10.2011 09:22, sir_wally_lewis wrote:
 so these functions look like:

You will need :

---ib_util.pp---
{
$Id: ib_util.pp,v 1.2 2000/10/26 07:09:13 frank Exp $

You will need this if you wish to use FREEIT, but
who will want to do this?
}
unit ib_util;
interface

function ib_util_malloc(_para1:longint):pointer;cdecl;external 'ib_util';

implementation


end.


then the following code should work

--
library fpc_udf_dt;
{$mode objfpc}
{$PACKRECORDS C}

uses ib_util,sysutils,dateutils;

{$linklib fbclient}  {I only need isc_decode_date at the moment}

type

  isc_quad= record
  isc_low:longint;
  isc_high:dword;
 end;

  pisc_quad=^isc_quad;

  Tm = record
  tm_sec : longint;   // Seconds
  tm_min : longint;   // Minutes
  tm_hour : longint;  // Hour (0--23)
  tm_mday : longint;  // Day of month (1--31)
  tm_mon : longint;   // Month (0--11)
  tm_year : longint;  // Year (calendar year minus 1900)
  tm_wday : longint;  // Weekday (0--6) Sunday = 0)
  tm_yday : longint;  // Day of year (0--365)
  tm_isdst : longint; // 0 if daylight savings time is not in effect)
  tm_gmtoff: longint;
   end;

procedure isc_decode_date(_para1:PISC_QUAD; _para2:pointer); cdecl; 
external;
procedure isc_encode_date(_para1:pointer; _para2:PISC_QUAD); cdecl; 
external;

procedure init_tm(var tm_date:Tm);
begin
   with tm_date do
   begin
tm_sec:= 0;
tm_min:= 0;
tm_hour   := 0;
tm_mday   := 0;
tm_mon:= 0;
tm_year   := 0;
tm_wday   := 0;
tm_yday   := 0;
tm_isdst  := 0;
tm_gmtoff{.low} := 0;
  {  tm_gmtoff.high:= 0; }
   end;
end;


{
/*Converts a Firebird datetime value to a pascal tdatetime*/
DECLARE EXTERNAL FUNCTION dt_topas
 date.
 RETURNS double precision by value
 ENTRY_POINT 'dt_topas' MODULE_NAME 'libfpc_udf_dt.so';
}

function fbdatetopascaldate( ib_datetime : PISC_QUAD):double;cdecl;export;
var
   tm_date:Tm;
begin
   init_tm(tm_date);
   isc_decode_date(ib_datetime,@tm_date);
   result:= EncodeDateTime(tm_date.tm_Year + 1900, tm_date.tm_mon + 1, 
tm_date.tm_mday,tm_date.tm_hour, tm_date.tm_min, tm_date.tm_sec, 0  );
end;


{
/*Converts a Firebird datetime value to a pascal tdatetime*/
DECLARE EXTERNAL FUNCTION dt_topas
 date.
 RETURNS double precision by value
 ENTRY_POINT 'dt_topas' MODULE_NAME 'libfpc_udf_dt.so';


}

function  pascaldatetofbdate(var pscl_dt : double):PISC_QUAD;cdecl;export;
var
   tm_date:Tm;
   ,mm,dd,hh,nn,ss,zzz : word;

begin
   init_tm(tm_date);
   decodedatetime(pscl_dt,,mm,dd,hh,nn,ss,zzz);
   tm_date.tm_min  := nn;
   tm_date.tm_hour := hh;
   tm_date.tm_sec  := ss;
   tm_date.tm_mday := dd;
   tm_date.tm_mon  := mm-1;
   tm_date.tm_year := -1900;
   result:=ib_util_malloc(sizeof(ISC_QUAD));
   isc_encode_date(@tm_date,result);
end;

exports
  fbdatetopascaldate name 'dt_topas',
  pascaldatetofbdate name 'dt_tofb';
end.
---

mit freundlichen Grüßen
Frank Schlottmann-Gödde

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling


Re: [firebird-support] Pascal UDF passing timestamps/strings

2011-10-07 Thread Frank Schlottmann-Gödde
On 07.10.2011 10:44, sir_wally_lewis wrote:
 Has anyone successfully written a pascal UDF
 to pass timestamps/strings without using
 the ibobjects library?

Yes, what problems do you face?

mit freundlichen Grüßen
Frank Schlottmann-Gödde

-- 
Fascinating creatures, phoenixes, they can carry immensely heavy loads,
   their tears have healing powers and they make highly faithful pets.
   - J.K. Rowling