Please see my sample program.
jBASE is allowing me save a record with null ID. Is there any specific
reason for this? or its a bug in jBASE?
Command->
0001 PROGRAM TEST.NULL
0002
0003 OPEN "XYZ" TO F.XYZ ELSE STOP "OPEN ERROR"
0004 WRITE.DATA = "HELLO WORLD"
0005
0006 ID = " "
0007
0008 WRITE WRITE.DATA TO F.XYZ,ID ON ERROR
0009 STOP "ID ERROR"
0010 END
0011
0012 STOP
Could anyone please clarify me?
Tks
Malai
jBASE4.1 on Aix5.2
Kevin Bilbee
________________________________
From: jB...@googlegroups.com on behalf of Kevin Bilbee
Sent: Tue 5/9/2006 7:30 AM
To: jB...@googlegroups.com
Subject: RE: Why jBASE is allowing Blank Space as Record ID?
That is not a null ID it is a char 20 and spaces are valid characters in a
record ID. Probably a bad idea to have whitespace as a record ID though.
Jbase your code should check for this situation and not allow it.
Interestingly, we used to throw out things that looked like mistakes such as a "" as an item ID and were badgered so much to not do this, that we stopped. A single space though is something that jBASE would have no way of knowing was a 'bad' ID or not, so it cannot start arbitratilly deciding waht is good or bad... that was MY job! ;-)
Jim
Dan
-----Original Message-----
From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of
jsh tom ~ -->SELECT TIMESHEETS ''
1 Records selected
jsh tom ~ -->DELETE TIMESHEETS
0 record(s) deleted.
jsh tom ~ -->DELETE TIMESHEETS ''
1 record(s) deleted.
Tom
Can you set a "global" trigger ? ie a trigger that runs on all files?
Regards
Simon
=======================================
Simon Verona
Dealer Management Services Ltd
Stewart House
Centurion Office Park
Julian Way
Sheffield
S9 1GD
Email: si...@dmservices.co.uk
Tel: 0870 080 2300
Fax: 0870 169 6747
There are many workarounds to avoid this type of situation.
I feel jBASE should not allow an empty space as a record ID.
Tks
Malai
There's a big difference between a space and a null ID. Neither is
a good idea, but historically the MV (aka Pick) model has permitted
that bit of "rope". Jbase is just being faithful to the model, as well
it should. There are countless ways you, as an applications developer,
can shoot yourself in the foot. Jbase allows you that power, expecting
that you will program judiciously. I much prefer this over a system
that applies all kinds of constraints, thereby limiting the developer
from doing pretty much anything desired. As a developer for 28+ years,
those constraints would be unacceptable to me. </soapbox>
Regards,
Charlie Noah
Inland Truck Parts
A trigger could be written for some generic task, but it would have to
purposely be assigned to every file on the system.
Why would you want to do such a thing?
Dan
-----Original Message-----
From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of
Simon Verona
Sent: Tuesday, May 09, 2006 12:58
To: jB...@googlegroups.com
Subject: RE: Why jBASE is allowing Blank Space as Record ID?
Interesting question, I'm just a bit lazy to find out myself...
Can you set a "global" trigger ? ie a trigger that runs on all files?
Regards
Simon
=======================================
Simon Verona
Dealer Management Services Ltd
Stewart House
Centurion Office Park
Julian Way
Sheffield
S9 1GD
-----Original Message-----
Regards
Simon
=======================================
Simon Verona
Dealer Management Services Ltd
Stewart House
Centurion Office Park
Julian Way
Sheffield
S9 1GD
Email: si...@dmservices.co.uk
Tel: 0870 080 2300
Fax: 0870 169 6747
________________________________
From: jB...@googlegroups.com on behalf of Simon Verona
Sent: Thu 5/11/2006 12:48 PM
To: jB...@googlegroups.com
Subject: RE: Why jBASE is allowing Blank Space as Record ID?
________________________________
From: jB...@googlegroups.com on behalf of T.Turkington
To prevent crap in the recordkey for one...
No - that is an application bug if it can happen! If a bucket has a hole in it you patch the hole (or get a new bucket), you don't catch the water in a complex system of pipes and pumps to put the water back in the bucket!
Jim
________________________________
________________________________
From: jB...@googlegroups.com on behalf of T.Turkington
Sent: Thu 5/11/2006 8:57 PM
To: jB...@googlegroups.com
Subject: RE: Why jBASE is allowing Blank Space as Record ID?
> A single line in which application? There are a couple hundred 'write'
> statements in our application. Not that this is really a problem in our
> application, but records can be created any number of ways. The idea for a
> 'global' trigger would be to prevent this particular type of 'error'
> regardless of the source. Malai (and I) can attest to the fact that NULL
> record id's do get created. Regarding 'overhead' well cpu's are relatively
> fast these days; I'm guessing Transaction Journaling/Distributed
> Files/Indexed files must have a similar 'overhead' without any noticable
> complaints from users...
Transaction logging is a system level function and has an overhead of about 30% throughput. If you start to do the same thign with triggers in BASIC at the applciaiton level your overhead will be very much more than that!
More importantly though, you argument is falacious. What would the application do if it trigger discovered a bad ID? Such a thing is an application bug and really you just need to fix it if you have it.
Jim
Charlie Noah
-----Original Message-----
From: Jim Idle [mailto:jB...@googlegroups.com]On Behalf Of Jim Idle
Sent: Friday, May 12, 2006 5:17 AM
To: jB...@googlegroups.com
Subject: RE: Why jBASE is allowing Blank Space as Record ID?
On jBASE 3 we set JBASE_WARNLEVEL appropriately and jBASE logged errors to the jbase_error_trace file, which enabled us to identify issues with the app that would not have been brought to our attention otherwise (divide by zero, uninitialized variable, etc.). We would routinely look in this file for errors, and correct the application code accordingly. Logging to this file, IMO, would have been a reasonable place for such global error notifications, of course not as good a hook into a jBC routine, though.
But it seems in jBASE 4 that error_trace functionality was drastically reduced, and now all we see in jbase_error_trace are TJ activity logs. Ah well. Whoever’s listening…