Sv: $execdirect()

Daniel Sananes daniel.s at kopparbergs.se
Thu Mar 9 00:43:18 UTC 2023


Hi
In pgAdmin i had to put "public" in front of the schema name.
Insert into public.user (fields) values (values).
With this it inserts ok.

Can someone explain this?

Regards
Daniel

-----Ursprungligt meddelande-----
Från: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> För Daniel Sananes
Skickat: den 8 mars 2023 20:34
Till: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Ämne: $execdirect()

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
VARNING: Det här e-postmeddelandet kommer från en extern avsändare. KLICKA INTE på länkar eller bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.


More information about the omnisdev-en mailing list