Questions tagged [sqlcode]

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.

40 questions
14
votes
4 answers

What can SQL CODE -104 (error) represent?

I am executing an SQL query via jcc to run a report. When I opened the error log file for the program and examined the SQL query, everything seems to be fine (There are no extra or missing brackets, commas, etc and the syntax is good) however when I…
Bernice
  • 2,552
  • 11
  • 42
  • 74
8
votes
3 answers

DB2 SQLCODE=-805, SQLSTATE=51002, SQLERRMC=NULLID.SYSLH203 0X5359534C564C3031

I am getting this error below : com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-805, SQLSTATE=51002, SQLERRMC=NULLID.SYSLH203 0X5359534C564C3031, DRIVER=3.58.81 in the execution of application after a certain point of time. Not got any…
Manu
  • 453
  • 2
  • 6
  • 15
5
votes
1 answer

how to check which column cause db2 22001 error?

Good day, org.springframework.dao.DataIntegrityViolationException: could not insert: [com.entity.payment.BPaymentItem]; SQL [insert into sc.PHistoryItem (amount, beneficiaryAccNo, beneficiaryBankCode, beneficiaryBankName, beneficiaryRef2, billCode,…
Panadol Chong
  • 1,793
  • 13
  • 54
  • 119
3
votes
2 answers

DB2 Logfile Limitation, SQLCODE: -964

I have tried a huge insert query in DB2. INSERT INTO MY_TABLE_COPY ( SELECT * FROM MY_TABLE); Before that, I set the followings: UPDATE DATABASE CONFIGURATION FOR MY_DB USING LOGFILSIZ 70000; UPDATE DATABASE CONFIGURATION FOR MY_DB USING LOGPRIMARY…
Afshin Moazami
  • 2,092
  • 5
  • 33
  • 55
2
votes
3 answers

To Calculate Value based on the stock available On Snowflake

I have the below table ID Week_No Value Available_Stock 1 1 200 1000 1 2 300 1000 1 3 100 1000 1 4 400 1000 1 5 500 1000 I want a table like this ID SUM(VALUE) Stock_Lasts_Weeks Available_Stock 1 800 4 Weeks 1000 As…
2
votes
1 answer

Alphanumeric sequence in SQL Server

For a single id column, we have sequence number 01, 02, 03 upto 99 repeating twice /thrice. Example: ID SEQ_NO ---------- 2 01 2 02 2 03 . . . 2 99 2 01 2 02 2 99 We have a requirement to add AA prefix to second time when it is…
2
votes
0 answers

DB2 Error SQLERRMC: DOUBLE

I am trying to run a query from my program, I am getting the below error message when I checked my logs, please provide me a solution/suggestion. com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -420, SQLSTATE: 22018, SQLERRMC: DOUBLE …
Sriram Lns
  • 223
  • 1
  • 4
  • 7
1
vote
1 answer

How to apply 'if sqlcode' in oracle to postgres?

code in oracle parameter info = in iv_column_1, in iv_column_2, inout iv_msg begin update main_table set column_1 = iv_column_1 where column_2 = iv_colmun_2; if sqlcode <> 0 then iv_msg := 'main_table error '||CHR (13)||CHR…
ksm5654f
  • 11
  • 2
1
vote
1 answer

Receiving an SQLCode of -379 when executing a stored procedure through DB2OLEDB

I'm attempting to call a stored procedure in DB2 using the Dd2OleDb ver.6 driver from C#. When calling cmd.ExecuteNonQuery, an OleDbException with a SQLCode of -379 is thrown. Full message is below. I have a similar call to another stored procedure…
Jack Whipnert
  • 275
  • 2
  • 8
1
vote
0 answers

Db2 A memory allocation error has occurred, com.ibm.db2.jcc.am.SqlException: SQLCODE=-83, DRIVER=3.65.77

I am getting error from Db2 saying : SQL Error [ ]: A memory allocation error has occurred.. SQLCODE=-83, SQLSTATE= , DRIVER=3.65.77 com.ibm.db2.jcc.am.SqlException: A memory allocation error has occurred.. SQLCODE=-83, SQLSTATE= ,…
Gautam
  • 3,707
  • 5
  • 36
  • 57
1
vote
3 answers

SQL Server : INSTEAD OF UPDATE trigger: dynamic code generation; inserted table not available

I have the following with an INSTEAD OF UPDATE trigger which dynamically generates code and then executes it. The problem is that when the code is executed I always get the error message: invalid object name 'inserted' The trigger code is like…
John Ranger
  • 541
  • 5
  • 18
1
vote
0 answers

How to retrieve SQLCODE using javax.persistence

I am using the EntityManager from javax.persistence to do some operations on a informix database. For example: public void execute(String sql) { Query query = entityManager.createNativeQuery(sql); query.executeUpdate(); } I need the SQLCODE…
Chris311
  • 3,794
  • 9
  • 46
  • 80
1
vote
0 answers

DB2 SQL Error Code -255

I've never seen this error code before, nor can I find any documentation on it. Here's the query: WITH QUERY AS ( SELECT rrn(T1), blah, bleh, ROW_NUMBER() OVER (order by bleh desc) AS RN FROM T1 WHERE ( upper(blah)…
0
votes
2 answers

How to rewrite SQL for PostgreSQL

I'm trying to rewrite two pieces of SQL Server code to PostgreSQL. The 1st one is: WHERE (DATEADD(S, Submit_Date, '1970-01-01')) >= DATEADD(d, -3, GETDATE()) OR (DATEADD(S, Last_Changed_Date, '1970-01-01')) >= DATEADD(d, -3,…
Emma V
  • 3
  • 1
0
votes
0 answers

SQL Date inclusions

I have a table I am trying to connect to to give me a name (however this name table has multiply entries for a name). StaffName dateFrom dateTo JIAO-L 2023-03-17 NULL JIAO-M 2017-07-25 2023-03-16 I want to being back the name based on…
1
2 3