4 Replies Latest reply: Feb 14, 2008 7:24 AM by 614881 RSS

    PLS-00428: an INTO clause is expected in this SELECT statement.

    614881
      One question i have;

      I know i have to wrap following codes in a procedure to invoke it from .NET platform and set the procedure as "stored procedure" of a DataSource of a GridView. So i tried the following code, yet it didn't work, throwing exception
      "Error(3,1): PLS-00428: an INTO clause is expected in this SELECT statement."


      create or replace procedure IhaleAktifSirketler(ihlkodu in NUMBER, ihlaltktgkodu in VARCHAR2)
      is

      begin

      with mydata as (
      select t2.teklif, t2.tarih, t1.ihlkodu, t1.ihlaltktgkodu, t1.kuladi,t4.ad from ihale_katilimcilar t1, ihale_hareket t2, ihale_sirket t4
      where t1.id_iliski=t2.id_iliski and t1.kuladi=t4.kullaniciadi and t1.ihlkodu=ihlkodu and t1.ihlaltktgkodu=ihlaltktgkodu and t1.aktif=1
      group by t2.teklif, t2.tarih, t1.ihlkodu,t1.ihlaltktgkodu,t1.kuladi,t4.ad
      )
      select
      max(decode(rn,1,teklif)) teklif,
      max(decode(rn,1,tarih)) tarih,
      max(decode(rn,1,ihlkodu)) ihlkodu,
      max(decode(rn,1,ihlaltktgkodu)) ihlaltktgkodu,
      kuladi,
      max(decode(rn,1,ad)) ad
      from
      (
      select teklif, tarih, ihlkodu, ihlaltktgkodu, kuladi, ad,
      row_number() over (partition by kuladi order by to_date(tarih,'dd/mm/yyyy hh:mi:ss am)') desc) rn
      from mydata
      ) group by kuladi order by 1;

      end IhaleAktifSirketler;
        • 1. Re: PLS-00428: an INTO clause is expected in this SELECT statement.
          450441
          Were you planning on doing anything with the result of this query? Perhaps use it in the .NET part of your application?

          So you have to SELECT the values INTO something that can be passed back to .NET. There are lots of ways of doing this. Perhaps you should consult the PL/SQL documentation.
          • 2. Re: PLS-00428: an INTO clause is expected in this SELECT statement.
            RKP
            In the execution block you can not put directly a select statement.
            Ex- Wrong:- Select sal from emp where emono='66872';

            Into clause should be there for every column.

            Ex- Select sal into v_sal from emp where empno='66872';

            Regards

            SUN
            • 3. Re: PLS-00428: an INTO clause is expected in this SELECT statement.
              614881
              Were you planning on doing anything with the result of this query? Perhaps use it in the .NET part of your application?

              I am planning to display the result of the query to the user. .NET doesn't support those PL/SQL statement such as "with xxx as...". It just didn't realize my code, in the execution block.

              So you have to SELECT the values INTO something that can be passed back to .NET. There are lots of ways of doing this. Perhaps you should consult the PL/SQL documentation.

              Yes, i see, however how could i select a recordset consisting of several records into what kind of variable. I need a variable of not number, string or etc. but something like a table that could hold those recorset as follows:

              consider here a recordset consisting of fields (count,date,id1,id2,user,company), as the result of my query

              1100YTL 12.02.2008 16:08:16 145 135 KE.ES JKL
              1400YTL 12.02.2008 14:35:07 145 135 KEM.ESM ASD

              Message was edited by:
              kem06.ora
              • 4. Re: PLS-00428: an INTO clause is expected in this SELECT statement.
                614881
                Yes, i see, however how could i select a recordset consisting of several records into what kind of variable. I need a variable of not number, string or etc. but something like a table that could hold those recorset as follows:

                consider here a recordset consisting of fields (count,date,id1,id2,user,company), as the result of my query

                1100YTL 12.02.2008 16:08:16 145 135 KE.ES JKL
                1400YTL 12.02.2008 14:35:07 145 135 KEM.ESM ASD

                In the execution block you can not put directly a
                select statement.
                Ex- Wrong:- Select sal from emp where
                emono='66872';

                Into clause should be there for every column.

                Ex- Select sal into v_sal from emp where
                empno='66872';

                Regards

                SUN