Error Sqlcode=-433 Sqlstate=22001
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you
Sqlcode=-433, Sqlstate=22001, Sqlerrmc=
might have Meta Discuss the workings and policies of this site sqlcode: -302, sqlstate: 22001, sqlerrmc: null About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting sqlcode=-433, sqlstate=22001, sqlerrmc=null ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n433.html million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up strange DB2 Exception while executing queries up vote 1 down vote favorite I am running some DB2 queries and after that I am calling a PL sql procedure calling of Procedure is CallableStatement callStmt = con.prepareCall( // http://stackoverflow.com/questions/28978614/strange-db2-exception-while-executing-queries "CALL INIT_PAYROLL(?,?,?,?,?,?,?,?,?,?)"); // Set IN parameters callStmt.setString(1, start_date);//IN callStmt.setString(2, end_date); //IN callStmt.setInt(3, customer_id);//IN callStmt.setString(4, payrollMain_id+"");//IN callStmt.setString(5, ruleFreq );//IN callStmt.setInt(6, 0); callStmt.setString(7, outerArray);//IN callStmt.setString(8, commsSepEmps);//IN callStmt.setInt(9, isIncremental); callStmt.registerOutParameter (10, Types.VARCHAR); //Call the procedure callStmt.executeUpdate(); toReturnStatus = callStmt.getString(10); System.out.println("OutPutResult-- : " + toReturnStatus); But some strange problem I am facing. I am clueless about why that is happening. Another Question is if I call this procedure from within of Java files, and If an exception occurs in PLSql procedure, will the exception be printed as DB2 exception? Error : [2/27/15 17:00:15:778 IST] 0000280f SystemErr R com.ibm.db2.jcc.am.SqlDataException: DB2 SQL Error: SQLCODE=-433, SQLSTATE=22001, SQLERRMC=129727:12068,133389:12069,133390:12070,133391:12071,133393:1, DRIVER=3.62.56 in this error 129727:12068 , is employee_id:primaryKeyOFtable , EDIT : The SP don't give problem in every case, I pass comma separated employeeIds in SP, only when it exceeds some certain limit/length, it fails and give this error. EDIT I solved/found the error, Actually I was passing a String whose length was exceeding the defined VarChar limit. :) java stored-procedures db
visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit http://www.dbforums.com/showthread.php?1679240-quote-problem-with-string-varchar-in-Dynamic-SQL from the selection below. Results 1 to 4 of 4 Thread: quote problem with string/varchar in Dynamic SQL Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid http://scn.sap.com/thread/3215668 Mode Switch to Threaded Mode 05-15-12,11:55 #1 dgo08 View Profile View Forum Posts Registered User Join Date May 2012 Posts 2 Unanswered: quote problem with string/varchar in Dynamic SQL Hi there. I´m new using DB2 and I´m facing some sqlstate 22001 problems and have decided to ask for help. I´ve been reading about using dynamic SQL to develop stored procedures so that I could give it table/column/etc in its call. I managed to get some working, but in a little more complex query I´ve got stucked and I´m thinking it is due to the quotes. Please take a look: CREATE OR REPLACE PROCEDURE TEST_DYNAMIC_SELECT( IN PROC_LANGUAGE CHAR(5), IN PROC_CHANNEL DECIMAL(3), IN PROC_PROJECT VARCHAR(50), IN PROC_CONDICTION VARCHAR(150)) LANGUAGE SQL RESULT sqlcode 302 sqlstate SETS 1 BEGIN DECLARE SEL_STMT VARCHAR(500); DECLARE C1 CURSOR WITH RETURN TO CALLER FOR S1; SET SEL_STMT = 'SELECT A. TEXT ,A. RTEXTOID ,A. HALT ,A. CPROJ FROM TABLE1 A, TABLE2 B WHERE A. CDSEN = B. CDSEN AND A. CHANNEL = B. CHANNEL ' || PROC_PROJECT || ' AND B. LANGUAGE = ' || PROC_LANGUAGE || ' AND B. CHANNEL = ' || PROC_CHANNEL || ' ' || PROC_CONDICTION || ' ORDER BY A. TEXT'; PREPARE S1 FROM SEL_STMT; OPEN C1; END I have 4 parameters: PROC_LANGUAGE = static (ex pt_PT) PROC_CHANNEL = static (ex 2) PROC_PROJECT = dynamic (could be any project the users is trying to get data) PROC_CONDICTION = dynamic (if a field from the screen is empty it appends one more AND in the end) When I try to call it: CALL TEST_DYNAMIC_SELECT('pt_PT',1,'AND A. CPROJ = 22','') (note that I wrote the first dynamic param) I got: [CALL - 0 row(s), 0.000 secs] [Error Code: -206, SQL State: 42703] DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=PT_PT, DRIVER=3.50.152 I noticed that the same error comes up when I execute de original query (all hardcoded) but without the single quotes where would be my first param: Select .... from.... AND B. LANGUAGE = 'pt_PT' works....but Select .... from.... AND B. LANGUAGE = pt_PT give me the same error message! I have no clue how to solve this problem...it is clea
and SafetyAsset NetworkAsset Operations and MaintenanceCommerceOverviewSubscription Billing and Revenue ManagementMaster Data Management for CommerceOmnichannel CommerceFinanceOverviewAccounting and Financial CloseCollaborative Finance OperationsEnterprise Risk and ComplianceFinancial Planning and AnalysisTreasury and Financial Risk ManagementHuman ResourcesOverviewCore Human Resources and PayrollHuman Capital AnalyticsTalent ManagementTime and Attendance ManagementManufacturingOverviewManufacturing NetworkManufacturing OperationsResponsive ManufacturingMarketingOverviewMarket with Speed and AgilityUnique Customer ExperiencesReal-Time Customer InsightsR&D/EngineeringOverviewDesign NetworkDesign OrchestrationProject and Portfolio ManagementSalesOverviewCollaborative Quote to CashSales Force AutomationSales Performance ManagementSelling Through Contact CentersServiceOverviewEfficient Field Service ManagementOmnichannel Customer ServiceTransparent Service Process and OperationsSourcing and ProcurementOverviewContingent Workforce ManagementDirect ProcurementSelf-Service ProcurementServices ProcurementStrategic Sourcing and Supplier ManagementSupply ChainOverviewDemand ManagementDemand NetworkLogistics NetworkManufacturing Planning and SchedulingResponse NetworkResponse and Supply ManagementSales, Inventory, and Operations PlanningTransportation ManagementWarehouse ManagementSustainabilityOverviewEnvironment, Health, and SafetyProduct Safety and Stewardship NetworkBrowse by IndustryAerospace and DefenseAutomotiveBankingChemicalsConsumer ProductsDefense and SecurityEngineering, Construction, and OperationsHealthcareHigh TechHigher Education and ResearchIndustrial Machinery and ComponentsInsuranceLife SciencesMediaMill ProductsMiningOil and GasProfessional ServicesPublic SectorRetailSports and EntertainmentTelecommunicationsTravel and TransportationUtilitiesWholesale DistributionBrowse Platform and TechnologyAna