Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: how do I insert after a query???

Re: how do I insert after a query???

From: <ttol_at_vda.nl>
Date: Wed, 29 Apr 1998 01:33:38 -0600
Message-ID: <6i6hk2$8kk$1@nnrp1.dejanews.com>


Katt,

Here's a 'template' that might be useful. PL/SQL is the language used. If you are using an other development environment, then you will have to rewrite the code of course.

Kind Regards,
Theo

DECLARE   v_found Varchar2(1);
  v_name Varchar2(15);

BEGIN   v_name := <name entered by user>

  Select 'x'
    Into v_found
    From <customer_table>
   Where name Like v_name;

  If v_found Is Null
  Then

     <Prompt user for data for new customer>   End if;

END; In article <35467a72.2455349_at_iinet.net.au>,   katt_at_iinet.com.au wrote:
>
> I want to make a query weather a customer exists(by name with user
> input entry) and if not...want to
> create a new customer which will prompt for the name and any other
> details that are available.
> Can someone please put me on the right track.
> My customer table is like this:
>
> Name Null? Type
> ------------------------------- -------- ----
> CUSTID NUMBER(4)
> PHONE NUMBER(7)
> NAME VARCHAR2(15)
> ADDRESS VARCHAR2(15)
> BILLING_TYPE VARCHAR2(3)
> BANKAC VARCHAR2(10)
> CONNECTION_DATE DATE
> DECODERID NUMBER(4)
> DISCON DATE
>
> Katt
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Apr 29 1998 - 02:33:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US