Franco Maregotto franco at hotelaqua.it
Sun Mar 12 11:47:40 UTC 2023

The first thing I might say is that if you override the tableClass, you get nothing when issuing @[$cinst.ColumnName]

What do you see if you put the mouse over any of the columns in the insert statement while debugging?

Anyway a good approach when you query the DB is to monitor the result with the following, at least until when you have good and fully tested code:
Do tsk_StatemObj.$execdirect()
Calculate ErrCode as tsk_StatemObj.$nativeerrorcode
Calculate ErrText as tsk_StatemObj.$nativeerrortext
Calculate ErrNative as tsk_StatemObj.$sqlstate()


> Il giorno 8 mar 2023, alle ore 20:34, Daniel Sananes <daniel.s at kopparbergs.se> ha scritto:
> Hi
> I am overriding a table.
> lStatementObj is an object derived from the taskobject tDatabase which have the session to Postgres.
> #insert()
> Calculate lInsertString as $cinst.$insertnames()
> If len(lInsertString)>0
>   Do tDataBase.$newstatement('now') Returns lStatementObj
>   Do lStatementObj.$execdirect(lStatement) Returns #F
> End If
> Quit method
> The execdirect gives #F as kFalse.
> The string lStatement is:
> insert into user ("user_id","user_name","user_psw","user_short") VALUES (@[$cinst.user_id],@[$cinst.user_name],@[$cinst.user_psw],@[$cinst.user_short])
> If I change the string to explicit values I still get kFalse:
> insert into user ("user_id","user_name","user_psw","user_short") VALUES ('200','name','password','short')
> the exact textstring, with explicit values inserts correct in pgAdmin.
> Have I not understood the $execdirect notation?
> /Daniel
> 0736 704070
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 

More information about the omnisdev-en mailing list