PostgreSQL connection without using a template?

I want to have a module using TPS, but with each inclusion made, I want to connect to a pgsql database and it records the same content!

If you declare a postgres table with the same structure as the tpstable, then you can follow an insert into the tps table with something like:

pg:record :=: tp:record
access:pgtable.insert()

If you really had to I guess you could also surround it with an OPEN and CLOSE of the postgres table, but I don’t know why you would want to do that.

You also need to think about whether you want the TPS transaction to fail if you can’t add the row to the postgres table, and what to do on updates and deletes. You could also write more code any do things without declaring a postgres table (except one to set up the connection), but I don’t know why you would do that either.

Maybe you should explain more why you want to do this and what the constraints are.

1 Like

can I ask why you want to do this?
Clarion can happily work with multiple file types, including creating a browse with a mix of tps and sql files. I did that when I was converting a system to PostgresSQL. I converted a file or 3 a week. It all just worked.

1 Like

Of course you can! I’m going to have a small application connected to the internet, but I want to record in the local tps and then transfer it to the postgres base in the cloud. To ensure that even if the internet goes down, the local system in tps will continue to work.!

I will control this by the status column, if it is “true” it was recorded in the postgres system… if it is “false” it was not recorded and when the local system has access again… all “false” will be recorded in the postgresql database!

the local base (TPS) and temporary and disposable…

Yes, this small application will not have updates or deletions. only inclusions. and to be sure I will have a “status” column to know which lines have been included or not. this application has a temporary base that is discarded at the end of the process.!

ok. Take a look at capesoft Replicate and it’s recommended replacement
https://www.capesoft.com/accessories/Replicatesp.htm

1 Like