Re: [firebird-support] Re: Firebird server resource recommendation for remote server?

2019-12-10 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you, Norbert. I passed on your information to the guy who is 
researching a new site.

Chuck

On 12/9/2019 2:53 AM, Norbert Saint Georges n...@tetrasys.eu 
[firebird-support] wrote:
> Chuck Belanger phytot...@lanset.com [firebird-support] a écrit :
>> NewsReader : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
>> Thunderbird/60.9.1
>> Newsgroups : gmane.comp.db.firebird.user
>> Reply-To : firebird-support@yahoogroups.com
>>
>> Oh, yeah. We are using FB 3+ (latest ver), 64 bit on the server.
> Hello,
>
> Being in the case, I will try to answer you even if my English is that
> of google ;-)
>
> I have VMs win2k8 r2 6 or 8 cores and 16giga with FB3 databases of 80
> to 300 giga average on a node in Germany connected from Finland.
>
>
> Points to consider in the order:
>
> 1) Network response time between client / server. Between 14ms & 30ms
> it's not bad. Attention to the network in PAT / NAT
>
> 2) Disk system, SSD is almost mandatory if you are working in native FB
> connection with forced writing.
>
> 3) Do not send a scan of the lungs in a blob native connection! use a
> micro or web service for that.
>
> 4) Query the DB via stored procedures.
>
> 5) Type of SLA of the provider.
>
> 6) Make several test from various suppliers on ipv4 wired before
> starting to work on the project
>






++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



[firebird-support] Re: Firebird server resource recommendation for remote server?

2019-12-09 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Oh, yeah. We are using FB 3+ (latest ver), 64 bit on the server.

Thank you,

Chuck

On 12/9/2019 12:16 AM, Chuck Belanger wrote:
> Hello:
>
> Getting ready to launch a  project which uses a remote DB to store and 
> disseminate client data as it is assigned to various practitioners 
> within a health network. We have been using a very funky old Windows 
> Server 2008 RC2, with minimal ram (I think 3gb) and only 1 cpu, for 
> the remote server during development and I would like to hear your 
> opinions about what would be a good starting server for the project. 
> We are looking into getting a new hosting service.
>
> My background is an acupuncturist who has made doing Delphi desktop 
> programming and working with Firebird my hobby and parttime job. Just 
> letting you know that so you can anticipate my level of experience 
> with the topic. I managed to set up the current server just by 
> following directions (from Mantis) and all the Firebird references I 
> could find. Other than that, I really did not know what I was doing. 
> And had no previous experience with this.
>
> Since 2003 I have developed a desktop program to do a particular 
> medical protocol. In the last few years the protocol's developer, is 
> getting ready to pull back on his own clinic work as he gets closer to 
> retiring and would like to mentor practitioners by assigning his 
> clients to them and monitor their progress and give support to the 
> practitioners.
>
> Initially, there are only two practitioners that work up to his 
> expectations and they would handle perhaps 3-20 clients per day. The 
> work would still be done on the individual desktop programs with their 
> local DB, but I have added threaded (IBObject based) routines to 
> send/retrieve client data to the remote DB. This allows for the mentor 
> to review the patient progress and when indicated, to re-assign 
> patients to other practitioners. Also, his office will bill the 
> patients and pay the practitioners.
>
> There are 9 threaded routines that connect separately to the remote DB 
> for each desktop program running. They do not all run at the same 
> time, but several do overlap. The server itself is hosting a Mantis BT 
> web site. There are 3 DBs there, 1 small authorization/security DB for 
> the program; 1 modest sized DB (initially a few hundred Mbs) that will 
> store session PDFs; and the main patient session records which is 
> starting out at 500 mb, because of commonly shared protocol data, and 
> could grow to multi-Gb in a year or so.
>
> What I am seeing in development are variable processing times for the 
> exact same routines, for the exact same data running all over the map. 
> In one instance (the initial remote DB check for new patients and 
> their data) ranges from a low of 6 seconds to as much as 1:09 minutes.
>
> I believe this has everything to do with the funky server, but I am 
> truly interested in making sure when switching to another host that we 
> start off with enough resources to handle what I describe. Can you 
> give me more details about what to ask for?
>
> Thank you,
>
> Chuck Belanger
>


[firebird-support] Firebird server resource recommendation for remote server?

2019-12-09 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

Getting ready to launch a  project which uses a remote DB to store and 
disseminate client data as it is assigned to various practitioners 
within a health network. We have been using a very funky old Windows 
Server 2008 RC2, with minimal ram (I think 3gb) and only 1 cpu, for the 
remote server during development and I would like to hear your opinions 
about what would be a good starting server for the project. We are 
looking into getting a new hosting service.

My background is an acupuncturist who has made doing Delphi desktop 
programming and working with Firebird my hobby and parttime job. Just 
letting you know that so you can anticipate my level of experience with 
the topic. I managed to set up the current server just by following 
directions (from Mantis) and all the Firebird references I could find. 
Other than that, I really did not know what I was doing. And had no 
previous experience with this.

Since 2003 I have developed a desktop program to do a particular medical 
protocol. In the last few years the protocol's developer, is getting 
ready to pull back on his own clinic work as he gets closer to retiring 
and would like to mentor practitioners by assigning his clients to them 
and monitor their progress and give support to the practitioners.

Initially, there are only two practitioners that work up to his 
expectations and they would handle perhaps 3-20 clients per day. The 
work would still be done on the individual desktop programs with their 
local DB, but I have added threaded (IBObject based) routines to 
send/retrieve client data to the remote DB. This allows for the mentor 
to review the patient progress and when indicated, to re-assign patients 
to other practitioners. Also, his office will bill the patients and pay 
the practitioners.

There are 9 threaded routines that connect separately to the remote DB 
for each desktop program running. They do not all run at the same time, 
but several do overlap. The server itself is hosting a Mantis BT web 
site. There are 3 DBs there, 1 small authorization/security DB for the 
program; 1 modest sized DB (initially a few hundred Mbs) that will store 
session PDFs; and the main patient session records which is starting out 
at 500 mb, because of commonly shared protocol data, and could grow to 
multi-Gb in a year or so.

What I am seeing in development are variable processing times for the 
exact same routines, for the exact same data running all over the map. 
In one instance (the initial remote DB check for new patients and their 
data) ranges from a low of 6 seconds to as much as 1:09 minutes.

I believe this has everything to do with the funky server, but I am 
truly interested in making sure when switching to another host that we 
start off with enough resources to handle what I describe. Can you give 
me more details about what to ask for?

Thank you,

Chuck Belanger



Re: [firebird-support] Firebird 3.0 installation not allowing database access with strange errors-HELP!

2018-09-14 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
For those who may be interested:

After much work and exploration, it turns out that FreeUDFLib.dll 
requires gds32.dll installed into System32 folder. Turns out the pas 
files reference some Delphi Interbase pas files.

In my previous installations installing gds32.dll was the default, but 
not in recent installations, thus the inconsistencies from system to system.

Chuck


On 9/1/2018 1:06 PM, Chuck Belanger phytot...@lanset.com 
[firebird-support] wrote:
> Hi, Mark:
>
> Thank you for your reply.
>
> The issue is that I am well aware (by now!) of these more common issues
> that could cause this.
>
> I realize that that "Internal consistency check" suggests a corrupt DB.
> But as I said, by simply moving the database (which btw was created by
> backing up under FB2.5 and then restoring it with FB3.0). So, the DB is
> not a copy per se.
>
> But, as I reported, method of access does in fact make a difference. And
> I am hoping that that is a clue about what is really going on.
>
> Embedded works
>
> Putting FBclient.dll in the app directory works.
>
> As well as Local, Loop and Remote
>
> Local, Default does not and gives that error. I strongly suspect the
> error is not really indicative of what is going on; just means that
> SOMETHING is wrong.
>
> I can copy the DB fie back to my development system where everything
> works fine and there is no error. Likewise, copying a perfectly good DB
> from my development system to one of these laptops and I get that error.
>
> Regarding UDF access: I have checked and triple checked all conf
> settings, and like I said the dll works fine on my development system,
> but not the VPS and now not these other 2 laptops. I am using FB 32 bit,
> not 64 bit, so bitedness (?) is not the issue.
>
> I suspect that the error for the udf would occur if Firebird cannot find
> the file, the file is absent or there is something preventing firebird
> from reading the file. As I said in my previous post, ALL udf libraries
> are affected, including the ones that come with FB.
>
> To me the big clue is that everything is working fine on my development
> system. So what's up with that? Assuming all systems have the same basic
> installation and configuration (they do) then either something is
> missing or something extra is there which affects the UDF access, and
> perhaps related to this Local Default access error.
>
> BTW, I tried using embedded with the UDF directory below the location of
> FBClient.dll and that had the same issue.
>
> Getting to your last line, and that does sound like what I am talking
> about. I can try adding the FB2.5 support dlls. Now that I think about
> it, what I did on my development system is simply stop the FB2.5 service
> and then install FB3.0. All the FB2.5 stuff is still there, although I
> am unclear how FB3.0 would properly manage accessing those DLLs.
> Although, this doesn't explain the udf libraries not working that come
> with FB3.0. On these other systems, either they never had FB2.5 or I
> uninstalled it, first.
>
> I will try these things and if you have any further ideas, I would love
> to hear them. Will report back.
>
> Thank you, again,
>
> Chuck
>
>
> On 9/1/2018 4:36 AM, Mark Rotteveel m...@lawinegevaar.nl
> [firebird-support] wrote:
>> On 1-9-2018 12:59, Chuck Belanger phytot...@lanset.com
>> [firebird-support] wrote:
>>
>>> There are so many issues here that I am confused about how to present
>>> this. If any one has some ideas and needs more information, I will do
>>> what I can to give it to you.
>>>
>>> Systems: all Win10, 2 are 64 bit, one 32 bit.
>> [..]
>>
>>> In testing the installer on two other laptops, after running the
>>> installer, the application will not load, giving me a simple error that
>>> the database cannot be connected to. When trying from within IBExpert,
>>> I get:
>>>
>>> *"Internal consistency check (cannot find tip page (165), file: tra.cpp
>>> line: 2323"*
>>>
>>> Googling did not help much with telling me how to resolve this.
>>> **
>> The error indicates that likely your database is corrupt. It expects to
>> read a TIP (Transaction Inventory Page), but can't find it.
>>
>>> This is with Local, Default protocol and I am pointing to the FB3
>>> directory for fbclient.dll.
>> This error should happen irrespective of method of access.
>>
>>> This happens for both systems.
>>>
>>> Since I use a program to do the DB conversion from FB 2.5 structure to
>>> FB 3.0 structure. I swapped out the DBs and copied over DBs from the
&g

Re: [firebird-support] Firebird 3.0 installation not allowing database access with strange errors-HELP!

2018-09-01 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hi, Mark:

Thank you for your reply.

The issue is that I am well aware (by now!) of these more common issues 
that could cause this.

I realize that that "Internal consistency check" suggests a corrupt DB. 
But as I said, by simply moving the database (which btw was created by 
backing up under FB2.5 and then restoring it with FB3.0). So, the DB is 
not a copy per se.

But, as I reported, method of access does in fact make a difference. And 
I am hoping that that is a clue about what is really going on.

Embedded works

Putting FBclient.dll in the app directory works.

As well as Local, Loop and Remote

Local, Default does not and gives that error. I strongly suspect the 
error is not really indicative of what is going on; just means that 
SOMETHING is wrong.

I can copy the DB fie back to my development system where everything 
works fine and there is no error. Likewise, copying a perfectly good DB 
from my development system to one of these laptops and I get that error.

Regarding UDF access: I have checked and triple checked all conf 
settings, and like I said the dll works fine on my development system, 
but not the VPS and now not these other 2 laptops. I am using FB 32 bit, 
not 64 bit, so bitedness (?) is not the issue.

I suspect that the error for the udf would occur if Firebird cannot find 
the file, the file is absent or there is something preventing firebird 
from reading the file. As I said in my previous post, ALL udf libraries 
are affected, including the ones that come with FB.

To me the big clue is that everything is working fine on my development 
system. So what's up with that? Assuming all systems have the same basic 
installation and configuration (they do) then either something is 
missing or something extra is there which affects the UDF access, and 
perhaps related to this Local Default access error.

BTW, I tried using embedded with the UDF directory below the location of 
FBClient.dll and that had the same issue.

Getting to your last line, and that does sound like what I am talking 
about. I can try adding the FB2.5 support dlls. Now that I think about 
it, what I did on my development system is simply stop the FB2.5 service 
and then install FB3.0. All the FB2.5 stuff is still there, although I 
am unclear how FB3.0 would properly manage accessing those DLLs. 
Although, this doesn't explain the udf libraries not working that come 
with FB3.0. On these other systems, either they never had FB2.5 or I 
uninstalled it, first.

I will try these things and if you have any further ideas, I would love 
to hear them. Will report back.

Thank you, again,

Chuck


On 9/1/2018 4:36 AM, Mark Rotteveel m...@lawinegevaar.nl 
[firebird-support] wrote:
> On 1-9-2018 12:59, Chuck Belanger phytot...@lanset.com
> [firebird-support] wrote:
>
>> There are so many issues here that I am confused about how to present
>> this. If any one has some ideas and needs more information, I will do
>> what I can to give it to you.
>>
>> Systems: all Win10, 2 are 64 bit, one 32 bit.
> [..]
>
>> In testing the installer on two other laptops, after running the
>> installer, the application will not load, giving me a simple error that
>> the database cannot be connected to. When trying from within IBExpert,
>> I get:
>>
>> *"Internal consistency check (cannot find tip page (165), file: tra.cpp
>> line: 2323"*
>>
>> Googling did not help much with telling me how to resolve this.
>> **
> The error indicates that likely your database is corrupt. It expects to
> read a TIP (Transaction Inventory Page), but can't find it.
>
>> This is with Local, Default protocol and I am pointing to the FB3
>> directory for fbclient.dll.
> This error should happen irrespective of method of access.
>
>> This happens for both systems.
>>
>> Since I use a program to do the DB conversion from FB 2.5 structure to
>> FB 3.0 structure. I swapped out the DBs and copied over DBs from the
>> development system on which they worked fine. Again, the same error.
>> Likewise, I took the converted DBs and moved to my development system
>> and they opened without error.
>   >
>> QED: I don't think this is a DB file issue, but a Firebird 3.0
>> installation/system error or difference. What do you think?
> What happens if you backup and restore to move the database instead of
> copying the database file?
>
>> On the laptops, if I set the protocol to Local, Loopbak, LocalHost, Port
>> 3050, I can connect, but the UDFs do not work during a SELECT qry.
>>
>> Likewise, if I set up an embedded FB3 environment, that can access the
>> DB; as well as simply putting the FBClient.dll in the app directory and
>> pointing to that as the client. None of these successful connection
>> all

[firebird-support] Firebird 3.0 installation not allowing database access with strange errors-HELP!

2018-09-01 Thread Chuck Belanger phytot...@lanset.com [firebird-support]

Hello:

There are so many issues here that I am confused about how to present 
this. If any one has some ideas and needs more information, I will do 
what I can to give it to you.


Systems: all Win10, 2 are 64 bit, one 32 bit.

On my "development" computer Win10, 64 bit, I had a previous 
installation of Firebird 2.52. I installed Firebird 3.0.3 on the system, 
re-pointed the location of the new FB3.0 client and in IBExpert have had 
no problems connecting with the converted databases from FB2.5. This 
includes accessing UDFs.


This includes my desktop application. In fact, I have noticed definite 
snappier response using FB3.0 over FB2.5.


Finished my application upgrade programming and put everything into an 
installer (Inno Setup), including a call to the FB3.0.3 exe installer. I 
install with the same setup choices that I have on my development 
computer. Before calling the installer, I run the uninstall for FB2.5. 
On my development system, I simply stopped the service and then 
installed. FB2.5 is on a different HD, then where I put FB3.0. These are 
the only differences that I am aware of.


In testing the installer on two other laptops, after running the 
installer, the application will not load, giving me a simple error that 
the database cannot be connected to. When trying from within IBExpert,  
I get:


*"Internal consistency check (cannot find tip page (165), file: tra.cpp 
line: 2323"*


Googling did not help much with telling me how to resolve this.
**

This is with Local, Default protocol and I am pointing to the FB3 
directory for fbclient.dll.


This happens for both systems.

Since I use a program to do the DB conversion from FB 2.5 structure to 
FB 3.0 structure. I swapped out the DBs and copied over DBs from the 
development system on which they worked fine. Again, the same error. 
Likewise, I took the converted DBs and moved to my development system 
and they opened without error.


QED: I don't think this is a DB file issue, but a Firebird 3.0 
installation/system error or difference. What do you think?


On the laptops, if I set the protocol to Local, Loopbak, LocalHost, Port 
3050, I can connect, but the UDFs do not work during a SELECT qry.


Likewise, if I set up an embedded FB3 environment, that can access the 
DB; as well as simply putting the FBClient.dll in the app directory and 
pointing to that as the client. None of these successful connection 
allow the UDFs to work, though.


I get in IBExpert: "Invalid Token; Invalid request BLR at offset 39. 
Function F_STR2STR is not defined module name or entry point could not 
be found." It is not just the one UDF, F_STR2STR, but ALL functions in 
FreeUDFLib.dll. This dll btw is the same that I use on my development 
system and another remote windows server, non-VPS, without any problems.


Perhaps coincidentally, I reported a few weeks ago that our new VPS, 
also, gets the same error message when accessing UDFs in dlls.


Back to the DB connection: If I change the protocol to Remote, TCP/IP, 
it connects properly to the VPS, but again, it cannot access the UDFs in 
the dlls.


So, my question is why can I not use Local, Default on these 2 
computers, but can use the other protocols. Likewise, what could be 
different about the FB3.0 installation on my development computer that 
allows it to access the UDFs and behave as expected when using Local, 
Default protocol? Are there some setup dll files that may be on my 
development computer but not on the other computers that affect this?


BTW, just to test it out, I uninstalled FB3.0.3 and then installed 
FB3.0.2--that didn't fix it--and then did the same for FB3.0.1 and that, 
too, did not fix anything. Same behavior.


Just tried to swap out the newly compiled FreeUDFLib.dll with an older 
compiled one and that, too, did not work on the laptop FB3.0 systems.


Thank you for any help,

Chuck




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Got it! Thanks.

Chuck


On 8/4/2018 5:11 AM, Mark Rotteveel m...@lawinegevaar.nl 
[firebird-support] wrote:
> On 4-8-2018 13:05, Chuck Belanger phytot...@lanset.com
> [firebird-support] wrote:
>> This worked beautifully. Thank you!
>>
>> There was no need to change my code, simply add a new OCTETS based
>> Domain and change domains on the field. All the Char(0)s are stored as
>> 0's in what looks like a HEX based number.
> You are confusing presentation in your query tool with storage within
> Firebird. Storage in Firebird is purely binary (bytes), not hex.
>
> Mark


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]

Thank you, River, I very much appreciate the tutorial.

Chuck


On 8/4/2018 3:59 AM, 'River~~' river14ap...@gmail.com [firebird-support] 
wrote:



Hi again Chuck

Sorry I was a bit cryptic there.

There follows a quick primer in logical bitwise operations

If it helps, use it. If not, code the "top bit setting" any way that 
makes sense to you. I would always recommend you code it the way you 
understand rather than the way some geeky C programmer says is more 
efficient!


When you do a bitwise AND or OR each bit is processed separately. The 
result of each bit is the AND of the corresponding bits in the input.


z and 1 is always a
z and 0 is always 0

z or 1 is always 1
z or 0 is always 0

Because each bit is processed in parallel on a 64bit machine you can 
do 64 of these in one cycle.


x80 (usually written with a leading zero 0x80 in most languages,  and 
read out loud as hex eight zero, means the base16 number 80) is binary 
1000. So in C the code


data = data | 0x80

performs a logical OR bit by bit. The first bit will always be 1 
regardless of the data, and the other seven bits preserved.


If you are sure the data is  <128 that is the same as

data = data + 128

If you were not sure you would need to code an if statement as well

If you are using 64bit integers you can set all the top bits at once with

data = data | 0x8080808080808080



Similarly in a single byte 0x7f is binary 0111 so

data = data & 0x7f

clears the top bit, and in 64bits that would be coded as

data = data & 0x7f7f7f7f7f7f7f7f

Programmers who habitually need to code bitwise stuff prefer using hex 
because of the way adjacent bytes just concatenate when you write them 
in hex.


You may know that binary 1000 is 128 and 0111 is 127 but I bet 
you don't know the decimal integer value of that long hex value. Nor 
do I, but I do know what it would look like in binary. It's eight lots 
of 7f so in binary it's just eight lots of 0111


Most modern languages have ways to do bitwise logical ops (though 
Pascal for example disguises them as set operations)




River~~
who has written too much machine code and assembler in the past  ;)


On Sat, 4 Aug 2018, 10:44 Chuck Belanger phytot...@lanset.com 
 [firebird-support], 
> wrote:


Thank you guys for your thoughtful response!

I really like the idea of just using 7 bits and keeping the 8th a
'1', thus ruling out the possibility of ever having a #0. It is an
easy conversion in my routine and storage.

As far as I know NONE or OCTET is the closest thing to rawbyte,
but as I mentioned (and another responded) the string is being
truncated at the first #0. His comment is probably true: somewhere
in IBO this is happening. Waiting on the IBO forum to respond.

Adding another table with a couple of columns seems like too much,
too. I was thinking of abandoning my attachment to the BIN to Char
conversion, which ultimately is arbitrary. A simple encryption of
the BIN string would probably work well, too, albeit longer, but
really, even if 8x as much storage we are not talking about much.

BLOBs just seem like over kill for storing a max of 64 chars!

Not sure I follow how to OR, AND the bytes.  What does x80 and x7F do?

Thank you, both!

Chuck


On 8/4/2018 12:46 AM, 'River~~' river14ap...@gmail.com
 [firebird-support] wrote:

Hi Chuck

I am a Firebird newbie so don't know if Fbd will let you do what
you want. Perhaps there is a fixed length raw byte field you
could use, or perhaps a blob?

If it does not, then a more efficient work around than the one
yours would be to store only seven bits to a byte, forcing the
top bit to 1.

This is an inefficiency in terms of storage space but the
complexity on retrieval would be simplified greatly, as would the
home grown code to repack the data. And you save the storage
overhead of the subrecord sequence numbers.

The packing routine would move 7 bytes of data into each 64bit
word, and vice versa on retrieval.


An even cruder hack to save packing and repacking the data is to
process it in 7bit form throughout. Before storing you would OR
each byte with x80 and on retrieval AND it with x7F. That would
mean having a dummy group every eighth group that nobody ever
belongs to, which moves the complication elsewhere in your code.

Either of these workarounds would be more efficient for data
access, more efficient in running your custom code  and easier to
write that code too.

Could that be worth an extra 1/7 cost in storage space?

Regards
River~~

On Sat, 4 Aug 2018, 01:30 Chuck Belanger phytot...@lanset.com
 [firebird-support],
mailto:firebird-support@yahoogroups.com>> wrote:

Hello:

I have been using a str

Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
This worked beautifully. Thank you!

There was no need to change my code, simply add a new OCTETS based 
Domain and change domains on the field. All the Char(0)s are stored as 
0's in what looks like a HEX based number.

Chuck


On 8/4/2018 1:54 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:
> 04.08.2018 0:49, Chuck Belanger phytot...@lanset.com [firebird-support] wrote:
>> The above string is created and
>> stored in a string just as you see it, but how do I store it in Firebird
>> , preferably as-is in a table field?
> Use field (VAR)CHAR CHARACTER SET OCTETS. Then "just store" your string.
>
>> I have tried rawbytestring but that truncates the string at the first #0
>> character, thus losing the information in the '0' (or some other
>> character) that follows.
> It is a problem on client side, either in your program on in IBO.
>
>> My only solution right now is to create a new table in a one:many
>> relation, such that I can have more than one record per Access code.
> It would be a right solution if you made one step further and forget 
> about bitmasks at
> all. Just keep access rights as one record per table and user:
>
> CREATE TABLE rights (user INTEGER, table INTEGER, allowed BOOLEAN)
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you, I will try that first.

Chuck


On 8/4/2018 2:46 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:
> 04.08.2018 11:44, Chuck Belanger phytot...@lanset.com [firebird-support] 
> wrote:
>> As far as I know NONE or OCTET is the closest thing to rawbyte, but as I 
>> mentioned (and
>> another responded) the string is being truncated at the first #0.
> Yes, that's the case for charset NONE. OCTETS must be used for binary 
> strings.
>
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-04 Thread Chuck Belanger phytot...@lanset.com [firebird-support]

Thank you guys for your thoughtful response!

I really like the idea of just using 7 bits and keeping the 8th a '1', 
thus ruling out the possibility of ever having a #0. It is an easy 
conversion in my routine and storage.


As far as I know NONE or OCTET is the closest thing to rawbyte, but as I 
mentioned (and another responded) the string is being truncated at the 
first #0. His comment is probably true: somewhere in IBO this is 
happening. Waiting on the IBO forum to respond.


Adding another table with a couple of columns seems like too much, too. 
I was thinking of abandoning my attachment to the BIN to Char 
conversion, which ultimately is arbitrary. A simple encryption of the 
BIN string would probably work well, too, albeit longer, but really, 
even if 8x as much storage we are not talking about much.


BLOBs just seem like over kill for storing a max of 64 chars!

Not sure I follow how to OR, AND the bytes.  What does x80 and x7F do?

Thank you, both!

Chuck


On 8/4/2018 12:46 AM, 'River~~' river14ap...@gmail.com 
[firebird-support] wrote:



Hi Chuck

I am a Firebird newbie so don't know if Fbd will let you do what you 
want. Perhaps there is a fixed length raw byte field you could use, or 
perhaps a blob?


If it does not, then a more efficient work around than the one yours 
would be to store only seven bits to a byte, forcing the top bit to 1.


This is an inefficiency in terms of storage space but the complexity 
on retrieval would be simplified greatly, as would the home grown code 
to repack the data. And you save the storage overhead of the subrecord 
sequence numbers.


The packing routine would move 7 bytes of data into each 64bit word, 
and vice versa on retrieval.



An even cruder hack to save packing and repacking the data is to 
process it in 7bit form throughout. Before storing you would OR each 
byte with x80 and on retrieval AND it with x7F. That would mean having 
a dummy group every eighth group that nobody ever belongs to, which 
moves the complication elsewhere in your code.


Either of these workarounds would be more efficient for data access, 
more efficient in running your custom code  and easier to write that 
code too.


Could that be worth an extra 1/7 cost in storage space?

Regards
River~~

On Sat, 4 Aug 2018, 01:30 Chuck Belanger phytot...@lanset.com 
 [firebird-support], 
> wrote:


Hello:

I have been using a string of ''s and '1's to indicate
access to
the underlying position in a database. I have been storing this
string
of '000111' combinations by converting to a set of characters
representing each 8 "bits" of the actual 0s and 1s.

The problem I am facing is how to store those occasional strings that
look like this:


'ü@'#0'0'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0


It is not so much all the null characters after the '0', but that
null
character between the '@' and the '0'. The above string is created
and
stored in a string just as you see it, but how do I store it in
Firebird
, preferably as-is in a table field?

I have tried rawbytestring but that truncates the string at the
first #0
character, thus losing the information in the '0' (or some other
character) that follows.

I have not run across this issue before, but as my list of
possible user
access groups grows, it is apparent that some users have 8 positions
without having access to any of the related groups, thus the #0 in
the
string. And that would be OK, except that they do have access to some
group or groups after those 8 positions. Right now, the access code
truncates that part of the access code information because of the #0.

My only solution right now is to create a new table in a one:many
relation, such that I can have more than one record per Access code.
Each record would hold the characters up to the first #0 character
behind the character set. I would then store the number of #0
characters
that follow the string. That way I can iterate through the records
and
reconstruct the original ''s and '1's string.

Any thoughts?

Thank you,

Chuck

I did post this on IBObject forum, too. I do use IBO for my database
access. I use Firebird 3.0 on WIndows, mainly desktop. I use NONE
as my
default Character Set.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus








[firebird-support] How to store a string in Firebird which includes #0's in it?

2018-08-03 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

I have been using a string of ''s and '1's to indicate access to 
the underlying position in a database. I have been storing this string 
of '000111' combinations by converting to a set of characters 
representing each 8 "bits" of the actual 0s and 1s.

The problem I am facing is how to store those occasional strings that 
look like this:

'ü@'#0'0'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 


It is not so much all the null characters after the '0', but that null 
character between the '@' and the '0'. The above string is created and 
stored in a string just as you see it, but how do I store it in Firebird 
, preferably as-is in a table field?

I have tried rawbytestring but that truncates the string at the first #0 
character, thus losing the information in the '0' (or some other 
character) that follows.

I have not run across this issue before, but as my list of possible user 
access groups grows, it is apparent that some users have 8 positions 
without having access to any of the related groups, thus the #0 in the 
string. And that would be OK, except that they do have access to some 
group or groups after those 8 positions. Right now, the access code 
truncates that part of the access code information because of the #0.

My only solution right now is to create a new table in a one:many 
relation, such that I can have more than one record per Access code. 
Each record would hold the characters up to the first #0 character 
behind the character set. I would then store the number of #0 characters 
that follow the string. That way I can iterate through the records and 
reconstruct the original ''s and '1's string.

Any thoughts?

Thank you,

Chuck

I did post this on IBObject forum, too. I do use IBO for my database 
access. I use Firebird 3.0 on WIndows, mainly desktop. I use NONE as my 
default Character Set.



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[firebird-support] UDF library not working on VPS

2018-07-25 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

I am hoping someone can help me out with this.

We recently set up a VPS for use for a remote Firebird database to use 
in our desktop application for user authorization. The VPS is a Windows 
Server 2008. Initially, I loaded FB 3.0.3, both 64bit and 32 bit 
versions. The 32 bit for access by IBExperts.

I have added a couple of functions to the source code for FreeUDFLib.dll 
and recompiled that in Delphi 10.2 for both 32 and 64 bit. On my local 
machine those functions in FreeUDFLib.dll work fine. (F_STR2STR) They 
work fine also when testing on an older remote server that we have been 
using for FTP.

But when I try to do a SELECT F_STR2STR() on the VPS database, I am 
getting the error message:

"Invalid Token
Invalid request BLR at offset 60
Function F_STR2STR is not defined
Module  Name or entry point could not be found"

I get this error whether I am trying to access via my application 
(remotely to the VPS), or using IBExpert on my local machine and making 
a remote query to the VPS, or connecting via Remote Desktop to the VPS 
and making a local connection via IBExpert.

To simplify things I uninstalled the FB 3 64 bit server and reinstalled 
just the 32 bit server. Same issue.

Confirmed that the firebird.conf points to the UDF folder (I tried 
explicitly pointing to the directory, too) and that the same 
FreeUDFLib.dll is there as I have on my local development computer, 
where it works as expected.

I double checked that indeed the entry point Str2Str is correct in the 
code.

Also, to add to this mystery, I tried using another function for another 
commonly supplied UDF dll, RTRIM(). What happened consistently is that 
by calling this function in a SELECT statement from IBExpert crashed 
IBExpert, as in it would just close without error.

At this point I am completely at a loss about what is going on here. 
Although, it seems like there is something about the VPS setup that is 
an issue.

Can anyone help?

Thank you!

Chuck Belanger



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [firebird-support] Losing Firebird connection into a VPS

2018-07-19 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you!

The ISP would not confirm anything about his router, but I did set 
DummyPacketInterval = 60 and it works beautifully.

Chuck


On 7/19/2018 2:36 AM, Dimitry Sibiryakov s...@ibphoenix.com 
[firebird-support] wrote:
> 19.07.2018 1:31, Chuck Belanger phytot...@lanset.com [firebird-support] wrote:
>> Does anyone have any ideas on what I need to do to keep connected to the
>> remote (VPS) Firebird server?
> Best of all you must find the router (most likely it is CISCO) that has 
> "drop inactive
> TCP connections" feature enabled and re-configure it. Unfortunately, such 
> routers used to
> be on ISP side and you have no access to them, but you can try to complain to 
> ISP support.
> In mean time try to set "DummyPacketInterval" in firebird.conf to be less 
> than
> mentioned timeout (usually it is one or two minutes).
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus







++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



Re: [firebird-support] Losing Firebird connection into a VPS

2018-07-19 Thread Chuck Belanger phytot...@lanset.com [firebird-support]

Thank you for your reply:

Please provide more information:

- Which Firebird version (full version)?*Firebird 3.03.32900*
- What OS (and its version)?*Windows 10 Pro, 1803 client, Remote Server on VPS 
is Windows server 2008*
- What kind of firewall and virusscan software is used:*No virus scan at the 
remote VPS, that I am aware of; Windows Firewall.*

We have asked, and the hosting company denies it, but I am not totally sure 
that the hosting server does not terminate long running TCP/IP sessions.

Are there better questions to ask the hosting company?
Thank you again,
Chuck


On 7/19/2018 12:07 AM, Mark Rotteveel m...@lawinegevaar.nl 
[firebird-support] wrote:

On 2018-07-19 01:31, Chuck Belanger phytot...@lanset.com
[firebird-support] wrote:

Hello:

My background with Firebird has been mostly to use it for a local
desktop application. A few years ago we started to experiment with a
remote connection on a website and I have had no issues with that other
than the speed.

Recently, we plan to use FB 3 and a database as a remote application
authorization process. We shifted to a VPS hosting and what I have been
seeing is that while using IBExpert to connect, after maybe a couple of
minutes it is disconnected from the database. I have not tried to
connect through the application yet, but use IBExpert to do maintenance
on the remote database.

I have reviewed the Firebird conf file and cannot find any settings
which would cause this, nor can I find any settings (the connection
timeout is set for 0, which I assume means indefinite connection) in
IBExpert, nor are there any settings in the server windows firewall. We
also asked the hosting company about this and they did not seem to
know.

Does anyone have any ideas on what I need to do to keep connected to
the
remote (VPS) Firebird server?

Please provide more information:

- Which Firebird version (full version)?
- What OS (and its version)?
- What kind of firewall and virusscan software is used

Are you sure the hosting party doesn't terminate long running TCP/IP
connections? I once had a problem with using web sockets, and it turned
out that incoming TCP/IP connections that were open for a few minutes
got killed automatically, as the expectation was for REST-like services
with short request/response cycles.



Posted by: Mark Rotteveel 


++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++


Yahoo Groups Links








---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


[firebird-support] Losing Firebird connection into a VPS

2018-07-18 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

My background with Firebird has been mostly to use it for a local 
desktop application. A few years ago we started to experiment with a 
remote connection on a website and I have had no issues with that other 
than the speed.

Recently, we plan to use FB 3 and a database as a remote application 
authorization process. We shifted to a VPS hosting and what I have been 
seeing is that while using IBExpert to connect, after maybe a couple of 
minutes it is disconnected from the database. I have not tried to 
connect through the application yet, but use IBExpert to do maintenance 
on the remote database.

I have reviewed the Firebird conf file and cannot find any settings 
which would cause this, nor can I find any settings (the connection 
timeout is set for 0, which I assume means indefinite connection) in 
IBExpert, nor are there any settings in the server windows firewall. We 
also asked the hosting company about this and they did not seem to know.

Does anyone have any ideas on what I need to do to keep connected to the 
remote (VPS) Firebird server?

Thank you!

Chuck



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[firebird-support] How to clear all TABLE and FIELD descriptions in FB3?

2018-06-01 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

I have been doing UPDATE rdb$relations/rdb$relation_fields SET 
rdb$description = null. This is for a desktop application with a 
distributed DB.

With the constraints on UPDATING system tables in FB3 how do I do the 
same thing with ALTER TABLE or something similar? I don't see a 
DESCRIPTION parameter for adding or dropping such in the ALTER TABLE syntax.

Thank you,

Chuck Belanger


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [firebird-support] Re: Firebird 3: Not able to UPDATE RDB$Procedures

2018-06-01 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Thank you, Helen:

I thought the same, then I tried a few things and found the following:

1. Yes, both DBs used SYSDBA to attempt the system table UPDATE.

2. The difference turned out to be that for one there was actually some 
source code in the fields. While the other that threw an error message, 
already had NULL fields in all records.

3. When limiting the UPDATE to a specific record rather than the entire 
table and even then setting RDB$Procedure_Source = NULL only when there 
is some source code to null, then it works fine.

Chuck Belanger


On 5/31/2018 7:43 PM, Helen Borrie hele...@iinet.net.au 
[firebird-support] wrote:
>> Also, apparently, this is not a blanket restriction, since I can
>> successfully run the UPDATE RDB$PROCEDURES on at least 1 other
>> converted DB (that is essentially the same as the DB I cannot runthis 
>> UPDATE on).
> Smells like a privileges problem.  The updater has to be SYSDBA,
> rdb$owner_name or (on POSIX) root.  Could also be a regular user that
> has been granted and is logged in under the RDB$ADMIN role, or one that
> has been granted metadata privs on procedures through user name or
> role.
>
> HB
>
>
> ---
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
>
>
> 
> Posted by: Helen Borrie 
> 
>
> ++
>
> Visit http://www.firebirdsql.org and click the Documentation item
> on the main (top) menu.  Try FAQ and other links from the left-side menu 
> there.
>
> Also search the knowledgebases at 
> http://www.ibphoenix.com/resources/documents/
>
> ++
> 
>
> Yahoo Groups Links
>
>
>
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [firebird-support] Re: Firebird 3: Not able to UPDATE RDB$Procedures

2018-05-31 Thread Chuck Belanger phytot...@lanset.com [firebird-support]

Thank you. However, I am not clear at all about how to do this with SQL DDL.

Also, apparently, this is not a blanket restriction, since I can 
successfully run the UPDATE RDB$PROCEDURES on at least 1 other converted 
DB (that is essentially the same as the DB I cannot run this UPDATE on).


Chuck


On 5/31/2018 9:14 AM, blackfalconsoftw...@outlook.com [firebird-support] 
wrote:



I just finished a complete review of Carlos' migration guide.  I read 
it quite carefully but completely missed what appears to be a 
contradiction in his explanations for the updating of the source-code 
fields in the system tables.  See the following extract below...


>>>
With the expansion of SQL DDL statements in Firebird 3, virtually all 
operations that could be done only through direct changes to the 
system tables can now be done in "official" ways, via SQL DDL.
The only exceptions are the fields that store the source code of 
procedures and triggers, located in the RDB$PROCEDURES and 
RDB$TRIGGERS tables, respectively.


Application developers often want to hide the human readable version 
of their procedures and triggers to protect their intellectual 
property.SQL DDL offers no way to delete or hide th at source code. As 
an accommodation to that business need, Firebird 3 allows you to 
manipulate those two fields.

<<<

On the one hand Carlos is saying you can alter such fields with SQL 
DDL statements and on the other he is saying you can't; then goes on 
to provide SQL code that does just that.  This explanation is somewhat 
confusing to say the least.


However, maybe Firebird 3.x.x does NOT allow this as Carlos' manual 
suggests...


Steve Naidamast
http://www.blackfalconsoftware.com









---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


[firebird-support] Firebird 3: Not able to UPDATE RDB$Procedures

2018-05-31 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

Per googling and Carlos Cantu's FB3 Migration Guide (page: 110), we are 
still allowed to set RDB$PROCEDURE_SOURCE = null, and yet when trying to 
do just that on my app's converted FB2.5 to FB3 database, I am getting 
"update not allowed on Systems tables." ISC ERROR CODE 335545030

I noticed a mention that at some point there will be another option to 
blank out this metadata information, but more likely in FB4.

To make this issue more interesting, from within IB_Expert, I can do an 
update of the RDB$Procedures table on one converted DB, but not on the 
working DB. As far as I can tell the tables and DB are essentially the same.

Does anyone know what is going on here? Is there another way to blank 
out the Procedure source code?

Thank you!

Chuck Belanger


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[firebird-support] Blob concat not working in FB 2.5.2

2018-01-31 Thread Chuck Belanger phytot...@lanset.com [firebird-support]
Hello:

In a stored procedure I am trying to concat two blob TEXT fields. One 
typically is text with RTF formating code about 1-30k long and the other 
may be simple text about 1-4 k long.

According to the FB reference manual  ||  should output a 
 , but for the larger text blobs it will simply not concat 
the smaller text blobs at all, i.e. it outputs the larger text blob 
only. I have tried concat small blob text just fine, and as a test the 
same larger text blob field concat to itself and this does not work at all.

I am testing this in IBExpert.

Am I missing something here? How do I concat two text blob fields reliably?

Thank you!

Chuck