Re: RESOURCE LIST & XLIFF Resource Files

2017-03-08 Thread Steven via 4D_Tech
Miyako’s reply confirms that RESOURCE LIST does not work with XLIFF files, as I 
suspected.  

So having extracted my STR# resources into XLIFF files (with the help of 
Miyako's component, thanks again), what I would like to do is replicate its 
functionality, i.e. extract arrays of the ‘ids’ and ’resnames’ of all of the 
‘group’ elements present within those XLIFF files.  I am confident that that 
can be done, but as I said I am entirely out of my depth with respect to XML 
and native 4D XML commands.  

Any direction, better yet, sample code would be greatly appreciated.  

Thanks in advance.

Steven Prins
Santa Fe, NM


> On Mar 8, 2017, at 3:32 AM, 4d_tech-requ...@lists.4d.com wrote:
> 
> Message: 3
> Date: Wed, 8 Mar 2017 03:08:52 +
> From: Keisuke Miyako >
> To: 4D iNug Technical <4d_tech@lists.4d.com >
> Subject: Re: RESOURCE LIST & XLIFF Resource Files
> Message-ID: <7fd1fa79-e659-4e63-a649-592762650...@4d.com 
> >
> Content-Type: text/plain; charset="utf-8"
> 
> Hello,
> 
> the command RESOURCE LIST was never associated with XLIFF.
> 
> resource commands that work with XLIFF are:
> 
> STRING LIST TO ARRAY
> http://doc.4d.com/4Dv15/4D/15.4/STRING-LIST-TO-ARRAY.301-3274706.en.html 
> 
> 
> and
> 
> Get indexed string
> http://doc.4d.com/4Dv15/4D/15.4/Get-indexed-string.301-3274707.en.html 
> 
> 
> see also:
> 
> Appendix C: XLIFF architecture
> http://doc.4d.com/4Dv15/4D/15.4/Appendix-C-XLIFF-architecture.300-3285323.en.html
>  
> 
> 
>> 2017/03/08 1:22、Steven via 4D_Tech <4d_tech@lists.4d.com 
>> > のメール:
>> Does the 4D command “RESOURCE LIST” still work with XLIFF string resource 
>> files?
> 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Tim Nevels via 4D_Tech
On Mar 8, 2017, at 2:00 PM, David Samson wrote:

> One problem I came up against with external data files is that they are not
> multi user i.e. one user accessing it locks all other users out. I am on
> v14 so things might have changed.

But if you have the external database “served" from 4D Server, then it has 
shared access among 4D Client users. 4D Server will handle multiple users 
trying to access it at the same time by queueing the requests. It might allow 
simultaneous access for some operations but I’m not sure of that. 

All access needs to come from triggers on 4D Server, Stored Procedures, or from 
methods executed on the client if they have the “Execute on server” property 
selected. 

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: 4D 15.4 HF1 (windows) - crashes when run as service

2017-03-08 Thread Timothy Penner via 4D_Tech
Hi Randy,

It looks like I was wrong; I didn’t see the issue when I tested yesterday 
because I ran the service in Non-Interactive mode.

Apparently there is an issue with Interactive services or when a dialog/window 
is displayed within the service.

The bug is:
ACI0096507 : Crash when opening a window on 4D Server when it has been launched 
as a service on a Windows system

This bug has already been fixed in the latest nightly builds v15.209388 and 
v16.209387.

Reminder: it is not recommended to create user interface on 4D Server when 
launched as a service.

-Tim PENNER



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

[OFF] Details of NSA Hacking Group

2017-03-08 Thread Tim Nevels via 4D_Tech
Here’s some programming related information on the details of how the NSA 
hacking group, called “Equation Group”, operated and were found before the 
Snowden Wikileaks dump a few days ago. 

NSA and CIA both have groups of 20 - 100 people that spend all day hacking 
everything computer related, documenting it and testing it. Everything means 
Windows, macOS, Linus, Sun, iOS, Android, Smart TVs and anything that has an 
operating system and a USB port or an ethernet connection. 

They even provide the programmers with “programming standards” and “dos and 
don’ts” when writing a hack so that it cannot be traced back to the NSA or CIA. 
These guys are the most sophisticated hackers in the world. And we are paying 
for it since they are U.S. Government employees. Now WE know all THEIR secrets. 
Ironic, isn’t it…

Fascinating information if you are a programmer. 

https://wikileaks.org/ciav7p1/
https://arstechnica.com/security/2017/03/after-nsa-hacking-expose-cia-staffers-asked-where-equation-group-went-wrong/

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Nigel Greenlee via 4D_Tech
Pat

Ah Relationships-well you never mentioned them I was thinking of an 
Autistic System:)

…i guess there is no way other than external database file with 500 or so  
tables(that should be enough:))  as mentioned by Tim Nevels (You can easily 
automate the creation of the tables of course through your uncompiled structure.

(i would still put this in an external datafile if it where me! data can live 
there and not in the main database and therefore remain intact on upgrade)..

Nigel




> On 8 Mar 2017, at 14:34, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi Nigel,
> A cunning plan, but wouldn't work because
> a) only one database can be active at a time, so only one table would be
> accessible.
> b) We allow the customer to define their own relations between their
> tables, and that wouldn't be possible.
> 
> But I like your outside-the-box thinking :)
> Pat
> 
> On 8 March 2017 at 12:43, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
>> Pat
>> 
>> OK..
>> 
>> 
>> Let me suggest something crazy then...
>> 
>> 1) You create an external data(file) with a single table(with a trigger)..
>> Lets call this the template.-we never use the template
>> 
>> 2) When a user wants to create a custom table you duplicate the
>> template(Using LEP)..rename the ‘copy’ to reflect the custom table name.
>> The copy has a single table with a trigger(a generic trigger i
>> assume)..and a single field(UUID auto generate)..
>> 
>> 3) You use alter to alter the name of the table in the copy and add the
>> custom fields
>> 
>> So you end up with N external data-files one for each custom table.
>> 
>> …maybe someone has a better way
>> 
>> Nigel
>> 
>> 
>> 
>>> On 8 Mar 2017, at 12:32, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
>> wrote:
>>> 
>>> Hi Nigel,
>>> Yeah I did look into that option as well, but it doesn't solve the
>> trigger
>>> problem. Triggers are essential to us!
>>> Pat
>>> 
>>> On 8 March 2017 at 12:19, Nigel Greenlee via 4D_Tech <
>> 4d_tech@lists.4d.com>
>>> wrote:
>>> 
 Pat
 
 A sideways question for your concept.
 
 1) Are you creating the tables in the main structure or using the
>> external
 datafile( CREATE DATABASE IF NOT EXISTS DATAFILE
 <<$_t_CustomTablesPath>>;) .(I use an external datafile structure for
>> some
 things-very useful..it could be useful in your scenario as the created
 tables and data could remain intact with new builds.
 
 
 I have not tested to see if you can set the trigger code on a table in
>> an
 external data file and if you can do it compiled..the external datafile
>> is
 not compiled..but i suspect the answer is no!
 
 I guess the other option is to go back to the days before we had
>> triggers
 and set a process to look for modified records in the created tables…
 
 Nigel Greenlee
 
 
 
 
 
 
> On 8 Mar 2017, at 10:10, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
 wrote:
> 
> Hi Arnaud,
> Yes, but the thing is that the TABLES will not be missing, only the
 custom
> fields that the client created. Now if there was a REGENERATE MISSING
> FIELDS function ...
> 
> On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> 
>>> Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com
>>> 
 a
>> écrit :
>>> 
>>> [...] Also I've realised that there is another fundamental problem
>> with
>> the idea
>>> of allowing customers to create new fields: when we issue a program
>> update,
>>> those custom fields - and their data - will be lost!
>> 
>> See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
>> >> 
>> 
>> --
>> Arnaud de Montard
>> 
>> 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> 
>> **
>> 
> 
> 
> 
> --
> *
> CatBase - The Database Publishing Solution
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> 

Re: RESOURCE LIST & XLIFF Resource Files

2017-03-08 Thread Steven via 4D_Tech
> On Mar 8, 2017,Keisuke Miyako  > wrote:
> 
> Hello,
> 
> the command RESOURCE LIST was never associated with XLIFF.
> 
> resource commands that work with XLIFF are:
> 
> STRING LIST TO ARRAY



Doh!  I told you I you I suspected I might be missing something very simple.  
But not that simple!  Right under my nose all of the time in fact…

Should have made the subject “Am I blind?”

Thanks again, Miyako.  

Steven
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v15.4: Sequence number issue / Duplicate key error

2017-03-08 Thread John DeSoi via 4D_Tech

> On Mar 8, 2017, at 6:26 AM, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have exported the data to a tab delimited file, truncated the table, and 
> imported the data. Problem is still there.
> I have compacted the data file. Same problem.

After doing this import (or any other import where you assign an ID that did 
not come directly from Sequence number), have you verified that the Sequence 
number is greater than the largest imported number? If not, you might be just 
seeing the same problem over and over. You can use something like this for each 
ID field:

SCAN INDEX($id->;1;<)  //largest value
$last:=$id->
If (Sequence number($table->)<$last)
  SET DATABASE PARAMETER($table->;Table sequence number;$last)
End If


John DeSoi, Ph.D.



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Tim Nevels via 4D_Tech
On Mar 8, 2017, at 8:34 AM,Pat Bensky wrote:

> Yeah I did look into that option as well, but it doesn't solve the trigger
> problem. Triggers are essential to us!

Here is an idea:

Create the number of tables that you want for your users to be able to use, but 
only include 1 field for the primary key for each user table. Set the trigger 
options and add the trigger code. This is your starting point. 

Have another table that you maintain that contains the structure definition of 
all these user tables. Maybe with a name like "UserFieldsDefinitions”. Provide 
a nice UI so the user can create the fields that they want in each of these 
user tables. Store all this data in UserFieldsDefinitions. then use SQL to 
create the fields in the user tables.

When you send them a new structure file have some code in On Startup or On 
Server Startup to check the user tables and compare the fields to what you have 
stored in UserFieldsDefinitions. Probably only need to check if there is 1 
field in a user table. If this is true then you know this is the first time 
this data file was opened with this new structure file. 

Now use the data in UserFieldsDefinitions to run all the SQL code again and 
create all the fields in the user tables. You will need to create the fields in 
each table in the exact same order as before. Now you have recovered your 
“missing fields” for each table. And they are in the same order as before.

You will have to test this to make sure it works. I know that each field is 
given a UUID when you create it. That UUID would change each time you create 
the field using SQL. But I don’t think the field UUID comes into play when 
referencing fields in method code. I think they are still internally referenced 
by their field number. But you’ll need to test this entire process to ensure 
you don’t lose any existing field data when you update the structure and 
recreate the fields.

This would allow you to stop providing 500 fields in each of your user tables. 
And it would remove any limitations on how many date fields, text fields, real 
fields, etc. that are available in each user table. User can create as many as 
they want of each type in each user table. 

One thing that needs to explored and tested is deleted fields. Do you allow 
users to delete fields they create in user tables? If they delete “field 4” and 
then later create new field what will be the field number of the new field. 
Should it be 4 again, or should it be another number. How does that effect the 
data in the user table? Maybe you don’t let them delete any fields. Only thing 
they can do is make them invisible. Could be some issues here that can only be 
found by doing some testing. 

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v15.4: Sequence number issue / Duplicate key error

2017-03-08 Thread Alan Chan via 4D_Tech
We have been using Sequence Number for years without any problem. It depends 
how/when you use it

My suggestion is to make use of newer features such as Auto-increment on either 
UUID or Longint. If you don't want to use auto-increment for whatever reasons, 
you could call it at Trigger for new record. If you're paranoid like me, use 
following
codes to call sequence number.

ES_SequenceNo($error;->UniqueField) -> $error 

C_LONGINT($seqNo;$0;$1;$error;$F)
C_POINTER($2;$pSeqkey;$pTable)
$error:=CheckError_T ($1) //check if there's previous error
If ($error=0)
$pSeqkey:=$2
If ($pSeqkey->=0)  //only if auto-increment wasn't activated yet
$pTable:=FieldToFilePtr ($2)`return table pointer
$SeqNo:=Sequence number($pTable->)
$F:=Find in field($pSeqkey->;$SeqNo)
If ($F=-1)
$pSeqkey->:=$seqNo
Else 
$error:=SetError ($error;-17160)
End if 
End if 
End if 
$0:=$error

Alan Chan

4D iNug Technical <4d_tech@lists.4d.com> writes:
>Hi all,
>
>I ran into an issue while using SEQUENCE NUMBER in 4D v15.4, in a 
>client-server setup.
>
>I put the result in a field called ‘ID’, which is the primary key for that 
>table, and by default is unique. Auto increment is off.
>The code is running in a transaction.
>
>Frequently, users get the error ‘Cannot save the record, DUPLICATE KEY’.
>Then, I go to the structure and rebuild the index on that field (ID).
>
>They try again, and the record is saved without a problem.
>
>After a while, though, and after other users have added records to this table, 
>the problem re-occurs.
>Rebuilding the index again fixes the problem.
>
>I have exported the data to a tab delimited file, truncated the table, and 
>imported the data. Problem is still there.
>I have compacted the data file. Same problem.
>
>Any ideas what can be the cause?
> 
>Kind regards,
>
>Rudy Mortier
>Two Way Communications bvba  -
>

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v15.4: Sequence number issue / Duplicate key error

2017-03-08 Thread John DeSoi via 4D_Tech

> On Mar 8, 2017, at 9:09 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Currently, let's say a user begins a transaction ​and the new record gets
> the sequence number. Before that transaction is completed another user
> starts a new record (or that user starts another process to create another
> record) - and gets the same sequence number. The first one to save wins.

This is not true if you are using 4D's Sequence number function. As long as you 
create a new record (or duplicate one) other processes will get a different 
sequence number.

I have used this function for years (decades? yikes) without problems. The most 
likely issue is a programming mistake. You need to be sure that a new record 
(or duplicate) is created when assigning the sequence number.

John DeSoi, Ph.D.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Chip Scheide via 4D_Tech

On Wed, 8 Mar 2017 09:19:35 +, Pat Bensky wrote:
> Hi Chip,
> The problem with that scenario is that it would preclude the use of 4D
> features such as the report editor, 4DWrite, label editor, etc. - all
> things that our customers use. Or we would have to roll out our own, which
> I'm not inclined to do :)
true!
and that could be a lot of work - depending on what/how you did it.
 
> Also I've realised that there is another fundamental problem with the idea
> of allowing customers to create new fields: when we issue a program update,
> those custom fields - and their data - will be lost! So I think we are
> stuck with our current situation of having lots of spare tables with lots
> of fields. The only real issue with this is that it bloats the database.
> But that isn't such a concern these days - everybody has big storage
> capacity.
if you used a 2 table approach with the definitions and data in object 
field -
updates would not matter!
The data, and the definitions remain the same.

IF you need to update either you could "apply to selection" (though I 
do not know how that would work on an object - so think conceptually 
rather then literally) to add/remove/change the object properties

  
> Pat
> 
> On 8 March 2017 at 05:14, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
>> Pat,
>> how about :
>> 1 table - each record contains an object field which holds a table
>> definition, which the user can define.
>> 1 more table - each record has an object field which holds the data for
>> the table defined above
>> 
>> 
>>> I'm revisiting the idea of creating a flexible table structure with v16.
>>> Currently we have lots of user data tables defined, and they are
>>> activated/deactivated as required by each customer. This works OK but it
>>> adds a lot of overhead to the database, as it means we have more than 50
>>> tables, each with over 500 fields of various types. It would be much
>> better
>>> to be able to define tables on the fly.
>>> 
>>> The first obstacle is triggers. We can create a new table using the SQL
>>> CREATE TABLE command, but I can't see a way to programmatically add a
>>> trigger to it. Triggers can be enabled or disabled via the ALTER TABLE
>>> command, but how can a trigger be created? Is there ANY way to create a
>>> trigger?
>>> 
>>> Thanks!
>>> Pat
>> 
>> Hell is other people
>>  Jean-Paul Sartre
>> 
> 
> 
> 
> -- 
> *
> CatBase - The Database Publishing Solution
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Pat Bensky via 4D_Tech
Hi Nigel,
A cunning plan, but wouldn't work because
a) only one database can be active at a time, so only one table would be
accessible.
b) We allow the customer to define their own relations between their
tables, and that wouldn't be possible.

But I like your outside-the-box thinking :)
Pat

On 8 March 2017 at 12:43, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Pat
>
> OK..
>
>
> Let me suggest something crazy then...
>
> 1) You create an external data(file) with a single table(with a trigger)..
> Lets call this the template.-we never use the template
>
> 2) When a user wants to create a custom table you duplicate the
> template(Using LEP)..rename the ‘copy’ to reflect the custom table name.
> The copy has a single table with a trigger(a generic trigger i
> assume)..and a single field(UUID auto generate)..
>
> 3) You use alter to alter the name of the table in the copy and add the
> custom fields
>
> So you end up with N external data-files one for each custom table.
>
> …maybe someone has a better way
>
> Nigel
>
>
>
> > On 8 Mar 2017, at 12:32, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Hi Nigel,
> > Yeah I did look into that option as well, but it doesn't solve the
> trigger
> > problem. Triggers are essential to us!
> > Pat
> >
> > On 8 March 2017 at 12:19, Nigel Greenlee via 4D_Tech <
> 4d_tech@lists.4d.com>
> > wrote:
> >
> >> Pat
> >>
> >> A sideways question for your concept.
> >>
> >> 1) Are you creating the tables in the main structure or using the
> external
> >> datafile( CREATE DATABASE IF NOT EXISTS DATAFILE
> >> <<$_t_CustomTablesPath>>;) .(I use an external datafile structure for
> some
> >> things-very useful..it could be useful in your scenario as the created
> >> tables and data could remain intact with new builds.
> >>
> >>
> >> I have not tested to see if you can set the trigger code on a table in
> an
> >> external data file and if you can do it compiled..the external datafile
> is
> >> not compiled..but i suspect the answer is no!
> >>
> >> I guess the other option is to go back to the days before we had
> triggers
> >> and set a process to look for modified records in the created tables…
> >>
> >> Nigel Greenlee
> >>
> >>
> >>
> >>
> >>
> >>
> >>> On 8 Mar 2017, at 10:10, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
> >> wrote:
> >>>
> >>> Hi Arnaud,
> >>> Yes, but the thing is that the TABLES will not be missing, only the
> >> custom
> >>> fields that the client created. Now if there was a REGENERATE MISSING
> >>> FIELDS function ...
> >>>
> >>> On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
> >>> 4d_tech@lists.4d.com> wrote:
> >>>
> 
> > Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com
> >
> >> a
>  écrit :
> >
> > [...] Also I've realised that there is another fundamental problem
> with
>  the idea
> > of allowing customers to create new fields: when we issue a program
>  update,
> > those custom fields - and their data - will be lost!
> 
>  See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
>   >> 301-3036706.en.html
> >
> 
>  --
>  Arnaud de Montard
> 
> 
> 
> 
>  
> **
>  4D Internet Users Group (4D iNUG)
>  FAQ:  http://lists.4d.com/faqnug.html
>  Archive:  http://lists.4d.com/archives.html
>  Options: http://lists.4d.com/mailman/options/4d_tech
>  Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>  
> **
> 
> >>>
> >>>
> >>>
> >>> --
> >>> *
> >>> CatBase - The Database Publishing Solution
> >>> tel: +44 (0) 207 118 7889
> >>> w: http://www.catbase.com
> >>> skype: pat.bensky
> >>> *
> >>> **
> >>> 4D Internet Users Group (4D iNUG)
> >>> FAQ:  http://lists.4d.com/faqnug.html
> >>> Archive:  http://lists.4d.com/archives.html
> >>> Options: http://lists.4d.com/mailman/options/4d_tech
> >>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >>> **
> >>
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> FAQ:  http://lists.4d.com/faqnug.html
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: http://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> >>
> >
> >
> >
> > --
> > *
> > CatBase - The Database Publishing Solution
> > tel: +44 (0) 207 118 7889
> > w: http://www.catbase.com
> > skype: pat.bensky
> > 

Re: 4D v15.4: Sequence number issue / Duplicate key error

2017-03-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 mars 2017 à 13:26, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> a écrit :
> 
> Hi all,
> 
> I ran into an issue while using SEQUENCE NUMBER in 4D v15.4, in a 
> client-server setup.
> 
> I put the result in a field called ‘ID’, which is the primary key for that 
> table, and by default is unique. Auto increment is off.
> The code is running in a transaction.

I do the reverse:
- auto increment on
- no sequence number call
Let's say I'm lazy enough to consider primary key delivery is the DB job, not 
mine… 

But it seems your problem is the index, as you mention rebuilding fixes the 
issue. 
What is the index kind? 
Big table? 
Is it only since v15.4? (I should have started by this…)

-- 
Arnaud de Montard 



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v15.4: Sequence number issue / Duplicate key error

2017-03-08 Thread Nigel Greenlee via 4D_Tech
Rudy

In my vast head banging experience of this its usually that a record has been 
created with no ID, or in the case of sequence the 4D sequence is out of sync. 

My suspicions would be records in transactions or record deletions

Two suggestions..

1) Put some code in the ‘save’ part of the record that check the ID is unique 
before you save it.

if(Record number([Table])=-3)/if it is a new record not saved yet then there 
should be nothing with the id on
$_l_Max:=0
else
$_l_Max:=1//this record
end if
$ID:=[table]id

SET QUERY DESTINATION(Into variable;$_l_RecordCount)
Repeat
query([table];[table]id=$ID)
if($_l_RecordCount> $_l_Max)
$ID:=$ID+1 //..the id will clash
end if
until($_l_RecordCount<=$_l_Max)
SET QUERY DESTINATION(Into current selection)
[table]id:=$ID

1) add a UUID(auto increment) primary key make your existing ID not the 
primary/unique(no need to change relations or anything like that) and put 
something in to watch for duplicates and report them to you-then you can look 
at how they are happening without users having an issue). 




Rebuilding the index hides the problem because it resets the sequence number.



.
> On 8 Mar 2017, at 12:26, Two Way Communications via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Hi all,
> 
> I ran into an issue while using SEQUENCE NUMBER in 4D v15.4, in a 
> client-server setup.
> 
> I put the result in a field called ‘ID’, which is the primary key for that 
> table, and by default is unique. Auto increment is off.
> The code is running in a transaction.
> 
> Frequently, users get the error ‘Cannot save the record, DUPLICATE KEY’.
> Then, I go to the structure and rebuild the index on that field (ID).
> 
> They try again, and the record is saved without a problem.
> 
> After a while, though, and after other users have added records to this 
> table, the problem re-occurs.
> Rebuilding the index again fixes the problem.
> 
> I have exported the data to a tab delimited file, truncated the table, and 
> imported the data. Problem is still there.
> I have compacted the data file. Same problem.
> 
> Any ideas what can be the cause?
> 
> Kind regards,
> 
> Rudy Mortier
> Two Way Communications bvba  -
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Nigel Greenlee via 4D_Tech
Pat

OK..


Let me suggest something crazy then...

1) You create an external data(file) with a single table(with a trigger).. Lets 
call this the template.-we never use the template

2) When a user wants to create a custom table you duplicate the template(Using 
LEP)..rename the ‘copy’ to reflect the custom table name.
The copy has a single table with a trigger(a generic trigger i assume)..and a 
single field(UUID auto generate)..

3) You use alter to alter the name of the table in the copy and add the custom 
fields

So you end up with N external data-files one for each custom table.

…maybe someone has a better way

Nigel



> On 8 Mar 2017, at 12:32, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi Nigel,
> Yeah I did look into that option as well, but it doesn't solve the trigger
> problem. Triggers are essential to us!
> Pat
> 
> On 8 March 2017 at 12:19, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
>> Pat
>> 
>> A sideways question for your concept.
>> 
>> 1) Are you creating the tables in the main structure or using the external
>> datafile( CREATE DATABASE IF NOT EXISTS DATAFILE
>> <<$_t_CustomTablesPath>>;) .(I use an external datafile structure for some
>> things-very useful..it could be useful in your scenario as the created
>> tables and data could remain intact with new builds.
>> 
>> 
>> I have not tested to see if you can set the trigger code on a table in an
>> external data file and if you can do it compiled..the external datafile is
>> not compiled..but i suspect the answer is no!
>> 
>> I guess the other option is to go back to the days before we had triggers
>> and set a process to look for modified records in the created tables…
>> 
>> Nigel Greenlee
>> 
>> 
>> 
>> 
>> 
>> 
>>> On 8 Mar 2017, at 10:10, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
>> wrote:
>>> 
>>> Hi Arnaud,
>>> Yes, but the thing is that the TABLES will not be missing, only the
>> custom
>>> fields that the client created. Now if there was a REGENERATE MISSING
>>> FIELDS function ...
>>> 
>>> On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
>>> 
 
> Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
>> a
 écrit :
> 
> [...] Also I've realised that there is another fundamental problem with
 the idea
> of allowing customers to create new fields: when we issue a program
 update,
> those custom fields - and their data - will be lost!
 
 See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
 > 301-3036706.en.html
> 
 
 --
 Arnaud de Montard
 
 
 
 
 **
 4D Internet Users Group (4D iNUG)
 FAQ:  http://lists.4d.com/faqnug.html
 Archive:  http://lists.4d.com/archives.html
 Options: http://lists.4d.com/mailman/options/4d_tech
 Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
 **
 
>>> 
>>> 
>>> 
>>> --
>>> *
>>> CatBase - The Database Publishing Solution
>>> tel: +44 (0) 207 118 7889
>>> w: http://www.catbase.com
>>> skype: pat.bensky
>>> *
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> FAQ:  http://lists.4d.com/faqnug.html
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: http://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
> 
> 
> 
> -- 
> *
> CatBase - The Database Publishing Solution
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Pat Bensky via 4D_Tech
Hi Nigel,
Yeah I did look into that option as well, but it doesn't solve the trigger
problem. Triggers are essential to us!
Pat

On 8 March 2017 at 12:19, Nigel Greenlee via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Pat
>
> A sideways question for your concept.
>
> 1) Are you creating the tables in the main structure or using the external
> datafile( CREATE DATABASE IF NOT EXISTS DATAFILE
> <<$_t_CustomTablesPath>>;) .(I use an external datafile structure for some
> things-very useful..it could be useful in your scenario as the created
> tables and data could remain intact with new builds.
>
>
> I have not tested to see if you can set the trigger code on a table in an
> external data file and if you can do it compiled..the external datafile is
> not compiled..but i suspect the answer is no!
>
> I guess the other option is to go back to the days before we had triggers
> and set a process to look for modified records in the created tables…
>
> Nigel Greenlee
>
>
>
>
>
>
> > On 8 Mar 2017, at 10:10, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> >
> > Hi Arnaud,
> > Yes, but the thing is that the TABLES will not be missing, only the
> custom
> > fields that the client created. Now if there was a REGENERATE MISSING
> > FIELDS function ...
> >
> > On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >>
> >>> Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com>
> a
> >> écrit :
> >>>
> >>> [...] Also I've realised that there is another fundamental problem with
> >> the idea
> >>> of allowing customers to create new fields: when we issue a program
> >> update,
> >>> those custom fields - and their data - will be lost!
> >>
> >> See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
> >>  301-3036706.en.html
> >>>
> >>
> >> --
> >> Arnaud de Montard
> >>
> >>
> >>
> >>
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> FAQ:  http://lists.4d.com/faqnug.html
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: http://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> >>
> >
> >
> >
> > --
> > *
> > CatBase - The Database Publishing Solution
> > tel: +44 (0) 207 118 7889
> > w: http://www.catbase.com
> > skype: pat.bensky
> > *
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: http://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
*
CatBase - The Database Publishing Solution
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Nigel Greenlee via 4D_Tech
Pat

A sideways question for your concept.

1) Are you creating the tables in the main structure or using the external 
datafile( CREATE DATABASE IF NOT EXISTS DATAFILE  <<$_t_CustomTablesPath>>;) 
.(I use an external datafile structure for some things-very useful..it could be 
useful in your scenario as the created tables and data could remain intact with 
new builds.


I have not tested to see if you can set the trigger code on a table in an 
external data file and if you can do it compiled..the external datafile is not 
compiled..but i suspect the answer is no!

I guess the other option is to go back to the days before we had triggers and 
set a process to look for modified records in the created tables…

Nigel Greenlee






> On 8 Mar 2017, at 10:10, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi Arnaud,
> Yes, but the thing is that the TABLES will not be missing, only the custom
> fields that the client created. Now if there was a REGENERATE MISSING
> FIELDS function ...
> 
> On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> 
>>> Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a
>> écrit :
>>> 
>>> [...] Also I've realised that there is another fundamental problem with
>> the idea
>>> of allowing customers to create new fields: when we issue a program
>> update,
>>> those custom fields - and their data - will be lost!
>> 
>> See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
>> >> 
>> 
>> --
>> Arnaud de Montard
>> 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
> 
> 
> 
> -- 
> *
> CatBase - The Database Publishing Solution
> tel: +44 (0) 207 118 7889
> w: http://www.catbase.com
> skype: pat.bensky
> *
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What is Cadran?

2017-03-08 Thread Herr Alexander Heintz via 4D_Tech
„Cadran“ is french for „frame“.

You ran into a bug in 4D itself, as you might know much of 4Ds interfaces are 
programmed in 4D itself!

Most of the time these go away after a restart, otherwise delete all 
preferences and re-install the application.


> Am 08.03.2017 um 11:28 schrieb Douglas Cryer via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> I have  number of EPOS tills which use an engined 4D application which has 
> been in place for around 6 years with a few upgrades and version releases.  
> One of the till has just started reporting an error:
> 
> Error when executing the method “Cadran_1” at line number 8
> The method cannot be executed
> Project method cannot be found
> Cadran
> 
> I am baffled as I have no such method?  Does anyone know what might be 
> causing this?
> 
> Regards,  Dougie
> 
> 
> telekinetix Limited- J. Douglas Cryer
> Phone : 01234 761759  Mobile : 07973 675 218
> 2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
> Email : jdcr...@telekinetix.com   Web : 
> http://www.telekinetix.com 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

What is Cadran?

2017-03-08 Thread Douglas Cryer via 4D_Tech
I have  number of EPOS tills which use an engined 4D application which has been 
in place for around 6 years with a few upgrades and version releases.  One of 
the till has just started reporting an error:

Error when executing the method “Cadran_1” at line number 8
The method cannot be executed
Project method cannot be found
Cadran

I am baffled as I have no such method?  Does anyone know what might be causing 
this?

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.com 

 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Pat Bensky via 4D_Tech
Hi Arnaud,
Yes, but the thing is that the TABLES will not be missing, only the custom
fields that the client created. Now if there was a REGENERATE MISSING
FIELDS function ...

On 8 March 2017 at 09:59, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a
> écrit :
> >
> > [...] Also I've realised that there is another fundamental problem with
> the idea
> > of allowing customers to create new fields: when we issue a program
> update,
> > those custom fields - and their data - will be lost!
>
> See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE:
>  >
>
> --
> Arnaud de Montard
>
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 
*
CatBase - The Database Publishing Solution
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 mars 2017 à 10:19, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> a écrit 
> :
> 
> [...] Also I've realised that there is another fundamental problem with the 
> idea
> of allowing customers to create new fields: when we issue a program update,
> those custom fields - and their data - will be lost! 

See GET MISSING TABLE NAMES and REGENERATE MISSING TABLE: 


-- 
Arnaud de Montard 




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Tables created with SQL CREATE TABLE command and triggers

2017-03-08 Thread Pat Bensky via 4D_Tech
Hi Chip,
The problem with that scenario is that it would preclude the use of 4D
features such as the report editor, 4DWrite, label editor, etc. - all
things that our customers use. Or we would have to roll out our own, which
I'm not inclined to do :)

Also I've realised that there is another fundamental problem with the idea
of allowing customers to create new fields: when we issue a program update,
those custom fields - and their data - will be lost! So I think we are
stuck with our current situation of having lots of spare tables with lots
of fields. The only real issue with this is that it bloats the database.
But that isn't such a concern these days - everybody has big storage
capacity.

Pat

On 8 March 2017 at 05:14, Chip Scheide <4d_o...@pghrepository.org> wrote:

> Pat,
> how about :
> 1 table - each record contains an object field which holds a table
> definition, which the user can define.
> 1 more table - each record has an object field which holds the data for
> the table defined above
>
>
> > I'm revisiting the idea of creating a flexible table structure with v16.
> > Currently we have lots of user data tables defined, and they are
> > activated/deactivated as required by each customer. This works OK but it
> > adds a lot of overhead to the database, as it means we have more than 50
> > tables, each with over 500 fields of various types. It would be much
> better
> > to be able to define tables on the fly.
> >
> > The first obstacle is triggers. We can create a new table using the SQL
> > CREATE TABLE command, but I can't see a way to programmatically add a
> > trigger to it. Triggers can be enabled or disabled via the ALTER TABLE
> > command, but how can a trigger be created? Is there ANY way to create a
> > trigger?
> >
> > Thanks!
> > Pat
> 
> Hell is other people
>  Jean-Paul Sartre
>



-- 
*
CatBase - The Database Publishing Solution
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**