0 Replies Latest reply: May 15, 2011 5:18 AM by 783547 RSS

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

    783547
      I am running the following query

      Declare l_subscriberId number;
      begin
      Select ASN.subscriber_id into l_subscriberId FROM availablenumbers AVN INNER JOIN assignednumbers ASN ON AVN.number_id = ASN.number_id WHERE AVN.number_text = 0522304471;
      Select CS.first_name, CS.last_name_desc, CS.title, ST.type_description, CS.language_id FROM companysubscribers CS INNER JOIN subscribertypes ST on CS.subscriber_type_id = ST.subscriber_type_id WHERE CS.subscriber_id = l_subscriberId;
      end;

      i put the entire block into a string called queryStr and execute using the following.
      stmt = OracleConnect->createStatement(queryStr);
      res = stmt->executeQuery();

      i get the following error:
      PLS-00428: an INTO clause is expected in this SELECT statement

      i understand that i can out the values into local variables using the INTO statement, but that is not what i want to do. i want to return the results from the SELECT and examine them in my c++ function using the following

      while (res->next())
      {
      string test = res->getString(1);
      cout << test << endl;
      }

      how is this done?