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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:04:12+00:00 2026-05-28T19:04:12+00:00

I m executing following: db2 -tvsf ./sql/update_product.sql I have used eclipse for editing update_product.sql

  • 0

I m executing following:

db2  -tvsf ./sql/update_product.sql

I have used eclipse for editing update_product.sql and moved the file to unix box. I have also removed update_product.sql ^M character from the file before executing.

I’m getting the following error:

Database Connection Information

 Database server        = DB2/AIX64 9.7.0
 SQL authorization ID   = CGO_USER
 Local database alias   = JPN_DEV


DECLARE BEGIN DECLARE   v_eisidentifier VARCHAR(100)
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "DECLARE BEGIN DECLARE v_eisidentifier VARC" was
found following "BEGIN-OF-STATEMENT".  Expected tokens may include:
"<values>".  LINE NUMBER=1.  SQLSTATE=42601

The following is in the SQL file:

   CONNECT TO JPN_DEV USER devuser USING password;

   DECLARE 

   BEGIN

    DECLARE v_eisidentifier VARCHAR(100);
DECLARE v_categoryGuid DECIMAL(19,0); 
DECLARE v_localeGuid DECIMAL(19,0);
DECLARE v_realmGuid DECIMAL(19,0);
DECLARE v_catchingPhrase VARCHAR(120) ;
DECLARE v_genericName VARCHAR(80);
DECLARE v_ingredients VARCHAR(900);
DECLARE v_quantity VARCHAR (60);
DECLARE v_dose VARCHAR(40);
DECLARE v_nutritionFacts VARCHAR (900);
DECLARE v_productDescription VARCHAR (900);
DECLARE v_recommendedFor VARCHAR (200);
DECLARE v_promotionMessage VARCHAR (200);
DECLARE v_message VARCHAR (4500);


DECLARE C1 CURSOR FOR
    SELECT 
            EISIDENTIFIER,
            CATEGORY_GUID,
            LOCALEGUID,
            REALMGUID,
            CATCHING_PHRASE,
            GENERIC_NAME,
            INGREDIENTS,
            QUANTITY,
            DOSE,
            NUTIRITION_FACTS,
            PRODUCT_DESCRIPTION,
            RECOMMENDED_FOR,
            PROMOTION_MESSAGE,
            MESSAGE
        FROM 
            TEMP_UPLOAD_PRODUCT_ATTRIBUTES;

        FETCH C1 into :v_eisidentifier,     
                      :v_categoryGuid, 
                      :v_localeGuid,
                      :v_realmGuid,
                      :v_catchingPhrase,
                      :v_genericName,
                      :v_ingredients,
                      :v_quantity,
                      :v_dose,
                      :v_nutritionFacts,
                      :v_productDescription
                      :v_recommendedFor,
                      :v_promotionMessage,
                      :v_message
        ;
        DECLARE v_proudctGuid;  
        WHILE (SQLCODE=0) 
        DO
            IF EXISTS (SELECT 1 FROM PRD_PRODUCT WHERE EISIDENTIFIER = :v_eisidentifier)
            THEN
                SELECT GUID INTO :v_productGuid where PRD_PRODUCT WHERE EISIDENTIFIER = :v_eisidentifier;                       
                UPDATE PRD_PRODUCT_L10N
                SET CATEGORY_GUID = :v_categoryGuid,
                    REALMGUID = :v_realmGuid,
                    CATCHING_PHRASE =:v_catchingPhrase,
                    GENERIC_NAME =:v_genericName,
                    INGREDIENTS =:v_ingredients,
                    QUANTITY=:v_quantity,
                    DOSE=:v_dose,
                    NUTIRITION_FACTS=:v_nutritionFacts,
                    PRODUCT_DESCRIPTION=:v_productDescription,
                    RECOMMENDED_FOR:=v_recommendedFor,
                    PROMOTION_MESSAGE:=v_promotionMessage,
                    MESSAGE:=v_message
                WHERE PRODUCTGUID =:v_proudctGuid and LOCALGUID =:v_categoryGuid;
                IF SQLCODE <> 0 THEN
                    DBMS_OUTPUT.PUT_LINE ('ERROR:' || SUBSTR(SQLERRM,1,175));
                END IF

            ELSE 
                --  INSERT INTO --- should not be the case....
                DBMS_OUTPUT.PUT_LINE ('WARNING: THE PRODUCT' || :v_eisidentifier || ' NOT FOUND IN THE DATABASE' );
            END IF;

            IF EXISTS (SELECT 1 FROM PRD_PRODUCT_CATEGORY WHERE CATEGORY_GUID=:v_categoryGuid AND PRODUCT_GUID=:v_productGuid)
                DBMS_OUTPUT.PUT_LINE ('WARNING: PRODUCT NOT FOUND IN THE DATABASE' );
            ELSE 
                INSERT INTO PRD_PRODUCT_CATEGORY (CATEGORY_GUID, PRODUCT_GUID) VALUES (:v_categoryGuid,:v_productGuid); 
                IF SQLCODE <> 0 THEN
                    DBMS_OUTPUT.PUT_LINE ('ERROR: COULD NOT INSERT categoryGuid: ' || :v_categoryGuid || ' productGuid: ' || :v_productGuid || 'in PRD_PRODUCT_CATEGORY table'); 
                    DBMS_OUTPUT.PUT_LINE ('ERROR:' || SUBSTR(SQLERRM,1,175));
                END IF
            END IF;

            FETCH C1 into :v_productGuid,   
                      :v_categoryGuid, 
                      :v_localeGuid,
                      :v_realmGuid,
                      :v_catchingPhrase,
                      :v_genericName,
                      :v_ingredients,
                      :v_quantity,
                      :v_dose,
                      :v_nutritionFacts,
                      :v_productDescription
                      :v_recommendedFor,
                      :v_promotionMessage,
                      :v_message
            ;
        END WHILE;

END ;
COMMIT;

Please advise.

  • 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-28T19:04:14+00:00Added an answer on May 28, 2026 at 7:04 pm

    You appear to have an extra DECLARE after your connect statement.

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

Sidebar

Related Questions

When executing the following (complete) SQL query on Microsoft SQL Server 2000: SELECT B.ARTIFACTTNS,
I am successfully executing the following query in SQL Server 2008 built into VS2008:
If I try executing the following code f = file('test','rb') fout = file('test.out','wb') for
I am executing following code from this post : preg_match_all(/'(.+)' ((\w+)\(? ?(\d*) ?\)?)/, $sql,
When Executing the following linq to sql statement: var stuff = from l in
When executing the following block of code: foreach($eventfiles as $eventfile) { if($eventfile['filename']) { $file
I am getting following error ERROR:- Incorrect syntax near '+'. while executing following T-Sql
While executing the following code szNotes := SQL.FieldByName('Notes').AsString; throwing an fetch type out of
I try to create a standalone migration file by executing the following command: rails
I have a strange bit of functionality going on when executing the following code

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.