Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6916635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:37:42+00:00 2026-05-27T09:37:42+00:00

i am trying trying to get a query from oracle table called sys.all_objects into

  • 0

i am trying trying to get a query from oracle table called “sys.all_objects”
into a string variable, so then i can give it to “dbms_obfuscation_toolkit.DESEncrypt” as input, after than encrypted string will go in to “utl_file” so i can write it into a txt file.

Here’s the problem, when i try to query with this code;

DECLARE
TYPE name_array is array(50) OF varchar2(100);
var_input  name_array; 

BEGIN
SELECT owner
  INTO var_input
  FROM sys.all_objects;

  FOR i IN var_input.FIRST .. var_input.LAST
    LOOP
        dbms_output.put_line(var_input(i));
    END LOOP;
END;

and the error is;

ORA-06550: line 7, column 12:
PLS-00642: local collection types not allowed in SQL statements

any idea about geting through this issue ?

for the ones who want to see the full code ;

CREATE OR REPLACE DIRECTORY data AS 'd:\folder';
GRANT read, write ON DIRECTORY data TO PUBLIC;

DECLARE
var_input  varchar2(64) := 'Rndminpt';
var_key    varchar2(16) := 'Anahtar1'; 
var_enc    varchar2(1024);
var_dec    varchar2(1024);
var_file   utl_file.file_type;

BEGIN

-- (query part)

    dbms_obfuscation_toolkit.DESEncrypt(
        input_string     =>  var_input,
        key_string       =>  var_key,
        encrypted_string =>  var_enc);
    dbms_output.put_line('Encrypted...');

var_file := utl_file.fopen('DATA','textfile.txt','W');            
    utl_file.put_line(var_file,var_enc);
    utl_file.fclose(var_file);        
dbms_output.put_line('Writen in to text... ');      
END;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:37:43+00:00Added an answer on May 27, 2026 at 9:37 am

    Try to use cursors and BULK COLLECT instead:
    http://www.dba-oracle.com/t_oracle_bulk_collect.htm

    should look something like this:

    DECLARE
    TYPE name_array is array(50) OF varchar2(100);
    var_input  name_array; 
    
    
    cursor c1 is
    SELECT owner
      FROM sys.all_objects;
    
    BEGIN
        open c1;
        fetch c1 bulk collect into var_input;
        close c1;
    
      FOR i IN var_input.FIRST .. var_input.LAST
        LOOP
            dbms_output.put_line(var_input(i));
        END LOOP;
    END;
    

    Didn’t check the code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the query string from a string (not the current URL).
I'm trying to get the output of the query 'SHOW TABLES FROM database_name' into
I' trying to get some data from Oracle via ODBC to mySQL database. And
I was trying to get the count from a table with millions of entries.
I'm trying to build a query from an Oracle 11g database to use in
I'm trying to get better performance out of this Oracle query (which is terribly
I'm trying to do a SELECT INTO using Oracle. My query is: SELECT *
I'm trying to update a table in Oracle and I'm running into some difficulty.
I'm trying to get a query from a specific model. I'm having trouble getting
I'm trying to get a query working that takes the values (sometimes just the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.