Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Stored Procedure doesn't work at 19c

Martin1Aug 19 2019 — edited Aug 19 2019

Hi,

at our old Oracle database 12c we have a Java stored procedure getDirList which works fine but after migration to Oracle 19c i get the error illegal character: '#' at compilation when invoking an SQL command by prefix with #sql. Below is the java code of the java stored procedure.

Has somebody an idea what's wrong?

Many thanks in advance.

Regards,

Martin

  // Find all directories in a directory and

  // insert them into the table rsi_dir_file_list.

  // directory: Directory to be searched.

  public static String getDirList(String directory)

  {

    String vReturn = "Y";

    try

    {

      File path = new File(directory);

      String[] list = path.list();

      String element;

      File foundFile;

      for(int i = 0; i < list.length; i++)

      {

        element = list[i];

        foundFile = new File(directory, element);

        // Ignore Directories.

        if (foundFile.isDirectory())

        {

          #sql {INSERT INTO rsi_dir_file_list(filename) VALUES (:element)};

        }

      }

      return vReturn;

    }

    catch(Exception ex)

    {

      vReturn = ex.getMessage();

    }

    return vReturn;

  }

This post has been answered by cormaco on Aug 19 2019
Jump to Answer
Comments
Post Details
Added on Aug 19 2019
8 comments
7,051 views