473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DB2 Error: "MODIFIES SQL DATA" clause has not been specified

I created a user defined function like below
Expand|Select|Wrap|Line Numbers
  1. CREATE FUNCTION add_data_audit (tableName Varchar(100),oldValue Varchar(500),newValue Varchar(500),fieldName Varchar(200),userName Varchar(15),ipAddress Varchar(5),modifiedDate Date,auditableId bigint)
  2.     RETURNS BOOLEAN
  3.     NO EXTERNAL ACTION
  4.     NOT DETERMINISTIC
  5.     LANGUAGE SQL
  6.  
  7. F1: BEGIN ATOMIC
  8.  
  9.       -- #######################################################################
  10.     -- # Specify the SQL you want to execute by replacing the text within the
  11.     -- # [brackets] with your SQL. There are several ways to do this:
  12.     -- #    * Enter your SQL directly, or
  13.     -- #    * Cut and paste your SQL, or
  14.     -- #    * Right-click in the editor window and select Insert from File...
  15.     -- # Note: Be sure to end the statement with the terminator (usually ';')
  16.     -- # Example: SELECT COUNT(*) FROM SYSIBM.SYSTABLES;        
  17.     -- ######################################################################
  18.    INSERT INTO data_audit_infos(
  19.             organization_id, field_name, new_value, old_value, table_name, 
  20.             user_name, ip_address, modified_date,auditable_id)
  21.         VALUES ( userName, fieldName,newValue, oldValue, tableName, 
  22.             userName, ipAddress, modifiedDate, auditableId);
  23.    RETURN true;
  24. END
but it cant be deployed and giving the error below,
Create user-defined function returns SQLCODE: -374, SQLSTATE: 428C2.
ADMIN.ADD_DATA_AUDIT: 24: The "MODIFIES SQL DATA" clause has not been specified in the CREATE FUNCTION statement for LANGUAGE SQL function "ADMIN.ADD_DATA_AUDIT" but an examination of the function body reveals that it should be specified.. SQLCODE=-374, SQLSTATE=428C2, DRIVER=3.62.80
The "MODIFIES SQL DATA" clause has not been specified in the CREATE FUNCTION statement for LANGUAGE SQL function "ADMIN.ADD_DATA_AUDIT" but an examination of the function body reveals that it should be specified.. SQLCODE=-374, SQLSTATE=428C2, DRIVER=3.62.80
ADMIN.ADD_DATA_AUDIT - Deploy failed
Mar 27 '12 #1
1 2990
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

The error message says it all. You need to specify the MODIFIES SQL DATA option. If your SQL modifies data, like an INSERT or UPDATE, you need to specify the MODIFIES SQL DATA option.
Mar 27 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: James | last post by:
Please help me with this sql: SELECT z005aNORTHEAST_3days_Formula.Region, z005aNORTHEAST_3days_Formula.DiffofClaimsAssignment FROM (SELECT .Region, (.)-( .) AS DiffofClaimsAssignment FROM...
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
1
by: Miguel Angel Dinelli | last post by:
I´m trying to execute a project and I get this error System.InvalidCastException: Specified cast is not valid. I found in microsoft some Q in 327287, but I not sure how make to solution it. ...
1
by: Abdel | last post by:
I use an .aspx (user control) page as follow: <script runat="server"> Public Sub BtnSave_Click(byval obj As Object, e As EventArgs) ReadRecords() End Sub Private Sub ReadRecords() Dim...
2
by: Roel Van den Brande | last post by:
Hello I try to fill a dataset. This is my code string myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source= C:\\Inetpub\\wwwroot\\Notenhof\\data\\notenhof.mdb;"; OleDbConnection...
2
by: hfk0 | last post by:
Hello, I'm a newbie here and was wondering anyone could help me with this. I have a simple ASP.NET 2 web application running perfectly fine with IIS and SQLServerExpress installed locally on...
0
by: dmlinliverpool | last post by:
I am running VS.net 2005 Express and Sql Server 2005 Express. The DB and VS are both on the same PC. I cannot connect to a database from within VS. In Database Explorer I click Connect To...
3
by: bilbo | last post by:
Can anybody help me understand why I get the error "Syntax error in CONSTRAINT clause"? I get it in Access 2003 and Access 2007. Both are clean installs with no add-ins Running this code in...
1
by: samneil | last post by:
I have 1 Database( MS Access) with 9 tables and 6 queries, Now I'm trying to view my 2 different tables on my VB6.0 using 2 Datagrids and 2"adodc".... here are the names of my two tables:...
2
by: Emmanuel Ayivi | last post by:
Again am sorry for not leaving to expectation on this website, This may be because am new but I promise to adjust. I have a table "tblfeesdetails" which is updated by a command button click from a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.