🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #123

Re: insert into problem

#123
From: Isaac
Date: Sun, 08 Jun 2008 15:37
26 lines
1897 bytes
Wayne Niddery (TeamB) wrote:
> "Isaac" <no@no.com> wrote in message 
> news:484b16e4@newsgroups.borland.com...
>>>    select max(item_code) from inventory_items
>>>    where (inventory_items.inv_code = :p_to_inv_code)
>>>    and (inventory_items.item_code = :p_item_code)
>>>    into :v_max_item_code;
>>>
>>>    if (v_max_item_code is null) then
>>>      v_max_item_code = 1;
>>>    else
>>>      v_max_item_code = v_max_item_code + 1;
>>>
>>>    insert into inventory_items (INV_CODE, ITEM_CODE, ITEM_NAME, 
>>> CUR_QTY,
>>>      MIN_QTY, OB_QTY, OB_TOTAL_COST, UNIT_PRICE, UNIT_COST)
>>>    values (:p_to_inv_code, :v_max_item_code,
>>>      :v_item_name, :v_cur_qty, 0, 0, 0, 0, 0);
>>>  end
>
>
> Is this a multiuser system? If so, this method of getting a new key 
> for a new record is very dangerous. Use a generaotr for new keys.
>
ok I will do it
thanks
Technical Details
Message-ID: <484bfc03@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!txtfeed2.tudelft.nl!tudelft.nl!txtfeed1.tudelft.nl!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <484b07da@newsgroups.borland.com> <484b16e4@newsgroups.borland.com> <484b52eb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,ed255c09332ecd2c
X-Google-Attributes: gid114a0e,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 08 Jun 2008 18:37:19 +0300
From: Isaac <no@no.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: insert into problem
References: <484b07da@newsgroups.borland.com> <484b16e4@newsgroups.borland.com> <484b52eb$1@newsgroups.borland.com>
In-Reply-To: <484b52eb$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 41.234.201.204
Message-ID: <484bfc03@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1212939267 41.234.201.204 (8 Jun 2008 08:34:27 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!txtfeed2.tudelft.nl!tudelft.nl!txtfeed1.tudelft.nl!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail