SQLCODE is an element of the SQLCA that stores a warning or return code from an SQL process. If you are running in DB2 mode, the value in SQLCODE is a DB2 warning or return code.
Questions tagged [sqlcode]
40 questions
0
votes
1 answer
DB2 like clause with multiple values
How to use like clause with multiple values in DB2 version 12.01.
SELECT t1.* FROM table1 t1
, ( select (pattern_col) as term from help_table ) t2
WHERE t1.col1 like t2.term
Pattern_col contains n number of values like(%abc%, %xyz%, %nnn%,…

Seema
- 1
- 1
0
votes
1 answer
DB2 : SQL Error [42997]: Function not supported (Reason code = "21").. SQLCODE=-270, SQLSTATE=42997
I have to write a sql script to modify a lot of types of columns in my db2 database.
Everything goes well excpet for one specific table (script used is the same as others tables) and db2 returns always an error I don't understand.
Here is my script…

EBruno
- 11
- 7
0
votes
1 answer
Equivalent of Firebird "when any" for SQL exception trapping in InterBase
I need to extend an app written with Embarcadero Firemonkey for Windows to Android, so I need InterBase.
Besides there is no tutorial (none found so far at least) on how to use Firebird under Android, I have found a very important difference not…

Giovanni Brambilla
- 21
- 4
0
votes
2 answers
Sqlerrm() vs Sqlcode()
as Sqlerrm() returns message and code which is provided by orecle.
exception 1:
like for in implicit cursor when data not found error ouccers n we are writing exception handling like dbms_ou..(sqlerrm());
output:
ORA-01403: no data found
and for…

harsha lohana
- 25
- 6
0
votes
1 answer
DB2 LUW version 10.5.0.10 - Get Warning (Not found) Line in Stored Procedure
I'm trying to determine the line in a stored procedure or the last SQL-statement which is causing a warning / not found. As a workaround I'm using temporary variables which I manually set to determine in which part of my stored procedure a warning…

DB2User
- 3
- 2
0
votes
1 answer
DB2 LUW - Get Error Line in Stored Procedure
I'm trying to determine the line in a stored procedure or the last SQL-statement which is causing an error. As a workaround I'm using temporary variables which I manually set to determine in which part of my stored procedure an error occurs.
See the…

DB2User
- 3
- 2
0
votes
2 answers
Why is my query failing with SQLCODE = -420?
Can I get some help with this? I'll copy the code as well as the error. I looked up the error code
(DB2 SQL Error: SQLCODE=-420, SQLSTATE=22018, SQLERRMC=BOOLEAN)
but I'm not understanding what doesn't meet the requirements of the function? I'm…

cmurphy
- 5
- 3
0
votes
1 answer
Sqlcode of the cursor query in oracle
I have a oracle cursor with query
CURSOR cursor IS SELECT column1 FROM table_name WHERE column1 = 48200;
DBMS_OUTPUT.PUT_LINE(SQLCODE);
I need the SQLCODE of the query in the cursor. I wrote without cursor then i can get the SQLCODE but i need the…

Haja Asmath
- 1
- 5
0
votes
1 answer
Error in CREATE TYPE statement in DB2 for z/OS
i tried create an associative array with integer indexes
CREATE TYPE assocArray AS VARCHAR(1000) ARRAY[INTEGER];
And DB2 returns me this:
ILLEGAL SYMBOL 'ARRAY'. SOME SYMBOLS THAT MIGHT BE LEGAL ARE: CHECK UNIQUE NOT PRIMARY AS UPDATE IMPLICITY…

Bopinko
- 15
- 1
- 8
0
votes
1 answer
SQLCODE: -3015 when calling stored procedure
I have a stored procedure as follow:
CREATE OR REPLACE PROCEDURE "SMEADM"."COPY_TABLE_WITH_FILTER"
(IN IN_SOURCE_TABLE_NAME VARCHAR(50), IN IN_DEST_TABLE_NAME VARCHAR(50), IN IN_WHERE_CONDITION VARCHAR(1024))
NOT DETERMINISTIC
LANGUAGE SQL
SPECIFIC…

Panadol Chong
- 1,793
- 13
- 54
- 119
0
votes
1 answer
SQLCODE 433 SQLSTATE 42806 when running a DB2 procedure that generates insert statements
I am trying to pull together a script that will run through a given schema and output all of the table data as insert statements.
I have tested the script on a couple of tables and has completed successfully so started to run it on the full schema…

user3165854
- 1,505
- 8
- 48
- 100
0
votes
1 answer
how to get particular error logs from diaglog in db2
I am trying the db2diag command to get the all the logs ,captured in diaglog, containing a particular SQLCODE. Can any one help me with the command?

Kalpna Kashyap
- 11
- 5
0
votes
1 answer
Unknown SQLCODE values
I've had some problems with my database monitoring tool, Ignite. It fails to start because it gets an error for certain queries that it tries to do, this is an example:
SELECT CAST(stmt_text AS BLOB) igniteex, num_executions, num_compilations,…

Mats Rydberg
- 11
- 4
0
votes
1 answer
sqlca.sqlerrm.sqlerrmc SQL code -284
I am using embedded C:
the following query returns a strange SQLcode -284
EXEC SQL
select *
into :xx
from xx
where ....
if (SQLCODE < 0)
{
err_log( "code %ld sqlerrmc %s",sqlca.sqlerrm.sqlerrml,sqlca.sqlerrm.sqlerrmc);
…

The smart Eagle
- 53
- 7
0
votes
1 answer
db2 stored procedure error when update statement follows rollback
I have a stored procedure where at the end I check for errors and if there are errors I perform a rollback and then update the status on the batch table to 'FAILED'. When I run the stored procedure I regularly get an SQLCODE 818 error saying there…

user3165854
- 1,505
- 8
- 48
- 100