$execdirect()

Jeffrey Jones jjones at synergos.com
Thu Mar 9 15:37:39 UTC 2023


https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PUBLIC

> On Mar 8, 2023, at 4:43 PM, Daniel Sananes <daniel.s at kopparbergs.se> wrote:
> 
> 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.
> _____________________________________________________________
> 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