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 7038499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:40:36+00:00 2026-05-28T01:40:36+00:00

I am using a Data Analysis tool and the requirement I have was to

  • 0

I am using a Data Analysis tool and the requirement I have was to accept a value from the user, pass that as a parameter and store it in a table. Pretty straighforward so I sat to write this

create or replace
procedure complex(datainput in VARCHAR2)
is
begin
insert into dumtab values (datainput);
end complex;

I executed this in SQL Developer using the following statement

begin
complex('SomeValue');  
end;

It worked fine, and the value was inserted into the table. However, the above statements are not supported in the Data Analysis tool, so I resorted to use a function instead. The following is the code of the function, it compiles.

create or replace
function supercomplex(datainput in VARCHAR2)
return varchar2
is
begin
insert into dumtab values (datainput);
return 'done';
end supercomplex;   

Once again I tried executing it in SQL Developer, but I got cannot perform a DML operation inside a query upon executing the following code

select supercomplex('somevalue') from dual;

My question is
– I need a statement that can run the mentioned function in SQL Developer or
– A function that can perform what I am looking for which can be executed by the select statement.
– If it is not possible to do what I’m asking, I would like a reason so I can inform my manager as I am very new (like a week old?) to PL/SQL so I am not aware of the rules and syntaxes.

P.S. How I wish this was C++ or even Java 🙁

EDIT

I need to run the function on SQL Developer because before running it in DMine (which is the tool) in order to test if it is valid or not. Anything invalid in SQL is also invalid in DMine, but not the other way around.

Thanks for the help, I understood the situation and as to why it is illegal/not recommended

  • 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-28T01:40:37+00:00Added an answer on May 28, 2026 at 1:40 am

    You could use the directive pragma autonomous_transaction. This will run the function into an independant transaction that will be able to perform DML without raising the ORA-14551.

    Be aware that since the autonomous transaction is independent, the results of the DML will be commited outside of the scope of the parent transaction. In most cases that would not be an acceptable workaround.

    SQL> CREATE OR REPLACE FUNCTION supercomplex(datainput IN VARCHAR2)
      2     RETURN VARCHAR2 IS
      3     PRAGMA AUTONOMOUS_TRANSACTION;
      4  BEGIN
      5     INSERT INTO dumtab VALUES (datainput);
      6     COMMIT;
      7     RETURN 'done';
      8  END supercomplex;
      9  /
    
    Function created
    
    SQL> SELECT supercomplex('somevalue') FROM dual;
    
    SUPERCOMPLEX('SOMEVALUE')
    --------------------------------------------------------------------------------
    done
    
    SQL> select * from dumtab;
    
    A
    --------------------------------------------------------------------------------
    somevalue
    

    Tom Kyte has a nice explanation about why the error is raised in the first place. It is not safe because it may depend upon the order in which the rows are processed. Furthermore, Oracle doesn’t guarantee that the function will be executed at least once and at most once per row.

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

Sidebar

Related Questions

I am trying to export biometric data from an analysis using the ROCR package.
I am using Python and Numpy to do some data analysis. I have a
Background Information I have a distributed processing application that does data analysis. It is
I have a data-analysis question, that I could easily solve with some T-SQL or
I've used F# to do some quick data-analysis using datastructures from another project. To
I'm using R for data analysis, and I'm sharing some data with collaborators via
I have a very simple WPF application in which I am using data binding
I am making a 2D game in javascript/ajax, that will be using data stored
passing post data using cURL requires that the name of the input. However, I
I’m using django and reportlab tool generate Dynamic PDF reports. All the data in

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.