Skip to main content
Question

Uniface 10 : select , update, delete on postgresql database status -3

  • November 25, 2025
  • 7 replies
  • 56 views

ducournau dominique

HI,

 

When we perform queries (select, delete, update) on a PostgreSQL database under Uniface, if the query returns nothing (0 for select, 0 for update, or 0 for delete), we get an error in the status return.

exemple:"ERROR=-3·;
MNEM=<UIOSERR_EXCEPTIONAL>·;
DESCRIPTION=I/O error·;
COMPONENT=B54R0022·;
PROCNAME=B00_SQL·;
TRIGGER=EXEC·;
LINE=45·;
PROCLINE=sql "%%$SQL$", "$def""

requete update:update b50_article set rds_update=COALESCE(rds_update,0)+1, rds_version=COALESCE(rds_version,0)+1,rds_site_update='C1',bf_ancien=bf,bf_ancien_ref=bf_ref,bf=(select bf from b50_article a where a.marq=b50_article.marq and a.codeart=replace(b50_article.codeart,'DUP1','')),bf_ref=(select bf_ref from b50_article a where a.marq=b50_article.marq and  a.codeart=replace(b50_article.codeart,'DUP1','')),bf_date=(select bf_date from b50_article a where a.marq=b50_article.marq and a.codeart=replace(b50_article.codeart,'DUP1','')) where codeart like '%DUP1' and replace(b50_article.codeart,'DUP1','')=(select codeart from b50_article a where a.marq=b50_article.marq and a.codeart=replace(b50_article.codeart,'DUP1','') and a.codeart='06SA994798' and a.obsolete='F' and (a.bf<>b50_article.bf or a.bf_date<>b50_article.bf_date))

thank you

7 replies

OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • November 26, 2025

The -3 suggests that the sql statement is not correct.

 

I would try and cut and paste the update statement in sql workbench or a sql window and see if it works there.

 

Are you missing the point-virgule (;)


ducournau dominique

Hi,

SQL queries work fine. We are migrating the application from the Solid database to PostgreSQL. The queries were therefore working correctly.

for example: delete where codeart=''  , she deleted 0 lignes but under uniface, she generated a error status.


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • November 26, 2025

Solid will not work the same as PostgreSQL

You may find that ='' is not the same as is null.

The database connector options for PostgreSQL will have an impact.

 

I would see if (ctrl-w) activates the sql editor in uniface for your installment.  Try the command there and see if there are any errors.

I would reduce the sql query until it does work and see what is causing the error.

 

It may well be necessary to modify the sql to work with PostgreSQL.

 


ducournau dominique

Hi,
SQL queries work fine. but $status=-3. I paste the sql in worsheet and  the SQL queries work fine.

 


ducournau dominique

this querie  

update facture set ht=-ht where type_facture='AV' give the same error “-3” where there is no update.

 


OsmanShariff
Forum|alt.badge.img+3
  • Participating Frequently
  • November 26, 2025

click the first 6 boxes in the debugger settings to show io print

Let it run the sql

Check the message frame

You will get the reason for the error

 

As I said above:- 

maybe you need a semi colon (;) with PostgreSQL 

get anything to work and then work backwards to see what is not working

 

It should be very simple to find the cause of the problem


Ingo Stiller
Forum|alt.badge.img+3
  • Participating Frequently
  • November 27, 2025

Hi Dominique
My approach would be as follows:
Execute SQL scripts
a) select 1
If not fail then
b) select ht from facture
If not fail then
c) update facture set ht=ht
If neither a), b) nor c) work
Is there a debugger/profiler in PostGreSQL similar to the one in MS-SQL?
Then you could check whether the statement is even being received and where exactly the error is occurring.