Re: simple PL/SQL question

From: jim mcnamara <jmcnamar_at_swcp.com>
Date: 1 Aug 2002 09:16:41 -0700
Message-ID: <19b60539.0208010816.75157802_at_posting.google.com>


To answer your question - both work. The colon is carried forward to support older PL/SQL syntax.

What IS more important - do not use a constant in the predicate. DECLARE
v number;
v_name varchar2(30);
BEGIN
    v:=100;
    SELECT NAME
    INTO v_name
    WHERE empid = v;
END; For queries that will be run over & over always use variables in the WHERE clause. This has a major positive impact on performance.

jim mcnamara

vk02720_at_my-deja.com (vk02720) wrote in message news:<4d814faa.0207271452.5f9064da_at_posting.google.com>...
> While selecting into a variable like the following, how should the
> host variable be specified = :hostvariable or just hostvariable ?
>
> select name into v_name where empid = 100;
> OR
> select name into :v_name where empid = 100;
>
>
> I have seen the host variables referred to in both ways. What is the
> difference ?
> Does it matter if they are declared as VARIABLE or any other type ....
> ???
>
> TIA

Received on Thu Aug 01 2002 - 18:16:41 CEST

Original text of this message