Please free me from this - I'll PAY

Alex Clay aclay at mac.com
Tue Jan 30 13:25:31 EST 2018


Hi Das,

I recommend simplifying your code until you get the bare minimum working, then built it back out out from there. Here is a modified version of your example that should insert a customers record with the next cust_id from your sequence:

> Begin statement
> Sta: {INSERT INTO customers (cust_id) VALUES (nextval('seq_cust_id'))}
> End statement
> Do $cinst.$prepare() Returns lReturnFlag
> Do $cinst.$execute() Returns lReturnFlag

One issue I noticed was the space between "nextval" and "('seq_cust_id')". nexval() is a PostgreSQL function. When invoking functions in PostgreSQL there is no space between the function name and the open parentheses.

Alex

P.S. If this helps. please keep your money, or donate it to a worthy cause!

> On Jan 30, 2018, at 13:18, Das Goravani <das at goravani.com> wrote:
> 
> Friends 
> 
> I’m sitting here very frustrated as I have to be able to enter a new record with a serial number, I simply HAVE TO BE ABLE TO or I can’t move. 
> 
> I’ve been stuck for three days now on trying to get a serial generator number into a new record.  
> 
> I’m also stuck with Omnis not willing to accept my INSERT INTO statement which will supposedly fetch the number.  
> 
> If someone can get me OUT of this conundrum I will pay them with my credit card. 
> 
> Postgres Manual says to use in place of “VALUE” for the field:  nextval (‘serialgeneratorname’).   but I don’t know if this works as it won’t accept my INSERT INTO command that contains it.  
> 
> I have tried quoting everything, I have tried everything. 
> 
> If you choose to answer please stay on these topics and don’t post things to me which are way over my head.  I’m really trying to get an INSERT INTO command to work, and a serial generator contained in that to work. 
> 
> Or I’m looking for other ways to make a serial generator work 
> 
> Here’s the code from a Table Class that will not $prepare, it stops there saying “unrecognized custom attribute”, but if you look at my Sta: command there is nothing there unusual. I got the field names from the “$insertnames” command, $cinst is pointing to my row correctly.  This should work but doesn’t. Any ideas why ? 
> 
> 
> Begin statement
> 
> Sta: {INSERT INTO customers ("cust_id","cust_firstname","cust_lastname","cust_email","cust_phone","cust_address1","cust_address2","cust_city","cust_state","cust_zip","cust_balowed","cust_bizname") VALUES (nextval ('seq_cust_id'),@[$cinst.cust_firstname],@[$cinst.cust_lastname],@[$cinst.cust_email],@[$cinst.cust_phone],@[$cinst.cust_address1],@[$cinst.cust_address2],@[$cinst.cust_city],@[$cinst.cust_state],@[$cinst.cust_zip],@[$cinst.cust_balowed],@[$cinst.cust_bizname])  RETURNING ('cust_id')}
> 
> End statement
> Do $cinst.$prepare() Returns lReturnFlag.   <————it stops here, with unrecognized custom attribute
> Do $cinst.$execute() Returns lReturnFlag
> 
> No matter what I cut out of the Sta: command, right down to nothing left but the most basic, it STILL won’t $prepare
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




More information about the omnisdev-en mailing list