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

Home -> Community -> Usenet -> c.d.o.server -> Coverting a PL/SQL script into single query

Coverting a PL/SQL script into single query

From: prasanna <prkothan_at_hotmail.com>
Date: Tue, 25 Feb 2003 14:18:41 +0530
Message-ID: <1046162832.478792@sj-nntpcache-5>


Hi all,

This is the table:

SQL> descr cs_blob_data;

 Name                            Null?    Type
 ------------------------------- -------- ----
SCHOOL_ID                         NUMBER
 SCHOOL_ORDINAL           NUMBER
SCHOOL_DATA                   VARCHAR2(20)

SQL> This is the script. Can any one help me in converting this into single query

declare
last_ordinal number;
next_ordinal number;
school_identifier number;
input_text varchar(75);
begin
select school_id,max(school_ordinal) into school_identifie,last_ordinal from cs_school_data where school_id=1;
input_text:='Stanford'';
next_ordinal:=last_ordinal+1;
insert into cs_school_data(school_id,school_ordinal,school_data) values (school_identifier,next_ordinal,input_text); end if;
end;

Thanks In Advance,
Prasanna Received on Tue Feb 25 2003 - 02:48:41 CST

Original text of this message

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