visual Cobol Embedded

Dear All,

When we execute a  Select * From Table INTO :DCL_Table we get the content of all  columns of this Table without problema. Here we are in the Line Command of AIX 7.1 previus Connect to the Data Base.

When we PUT this SENTENCE in Visual Cobol Program with SQL Embedded , The columns return with Blanks.

The host variables are missing values ​​than those contained in the table.

 

Is there missing to SET in the environment whe we are working with AIX 7.1?

Is there Some problema with the Buffers  between Windows and UNIX ?

 

Many thanks in Advanced

 

PJM

 

 

 

  • Hi Pedro,

    Can you please provide some more detail?

    What database are you using and where is the program actually running, under AIX or under Windows?
    What is the definition of DCL_Table in your program?
    What SQL directives are you using when compiling, e.g. DBMAN=ODBC, COBSQL, DB2?

    Thanks.

  • We are Using SQL Server 2005 in Windows 2008.

    What is the definition of DCL_Table in your program?

    The Declare Table is :

    EXEc SQL DECLARE DataDima.dbo.dim_ojala Table (

           [CAMPO1] [NUMERIC] (1) NOT NULL,

           [CAMPO2] [char] (10)        NULL

            CONSTRAINT [PK_dim_ojala] ¨PRIMARY KEY CLUSTERED )

          The DCL definition is :

          01 DCL-OJALA.

               05 DCAMPO1         PIC 9(1).

               05 DCAMPO2         PIC x(10).

    THE SELECT SENTENCE IS :

               EXEC SQL

                   SELECT CAMPO1, CAMPO2

                                  INTO

                                            :DCAMPO1,

                                            :DCAMPO2

                                   FROM  dim_ojala

                                   WHERE  [CAMPO1]   = :WSCOD

                         END-EXEC

    What SQL directives are you using when compiling, e.g. DBMAN=ODBC, COBSQL, DB2?

    The Directive we are Using is  DBMAN=ODBC

    Many Thanks,

  • String data, right truncation (SQLCODE 000000001)

    Dear Chris,

    Maybe is the same Error Like this.......

    Problem:

    Error occurs  on select and insert of data via OpenEsql to sqlserver.

    String data, right truncation (SQLCODE 000000001)

    Running SQLServer 2005.  Datadirect ODBC64 v 53.

    Resolution:

    Correct by using OpenESQl in 32 bit mode with Datadirect 32 bit ODBC data sources

    Regards,

    PJM

    Server Express currently support OpenESQL in 32-bit mode,....to providing support for accessing 64-bit ODBC data sources from OpenESQL will be within the SX 5.1 timeframes. There is no commitment date at this time

  • String data, right truncation (SQLCODE 000000001)

    Dear Chris,

    Maybe is the same Error Like this.......

    Problem:

    Error occurs  on select and insert of data via OpenEsql to sqlserver.

    String data, right truncation (SQLCODE 000000001)

    Running SQLServer 2005.  Datadirect ODBC64 v 53.

    Resolution:

    Correct by using OpenESQl in 32 bit mode with Datadirect 32 bit ODBC data sources

    Regards,

    PJM

    Server Express currently support OpenESQL in 32-bit mode,....to providing support for accessing 64-bit ODBC data sources from OpenESQL will be within the SX 5.1 timeframes. There is no commitment date at this time

  • Pedro,

    What are the values of sqlcode, sqlstate and sqlerrmc after the SELECT?

    These should tell you exactly what the error is.

  • Dear Chris,

    sqlcode :   000000001,

    sqlstate : 02000

    sqlerrmc : Spaces

  • sqlcode 2000 would mean no data found but sqlcode 1 means that one of the warning flags should be set.

    Are any of the SQLWARN fields set to "W" after the select?

    These have the following meaning:

    SQLWARN Eight warning flags, each containing a blank or "W" (those not listed below are reserved): A warning flag will be set if SQLCODE contains a value of 1:

    SQLWARN0 A summary of all warning fields. Blank means there are no warnings.

    SQLWARN1 "W" indicates that data was truncated on output to a character host variable.

    SQLWARN2 "W" indicates that a null value exists, but no indicator variable was provided.

    SQLWARN3 "W" indicates that the number of columns is less than the number of host variables or that the number of host variables provided does not match the number of parameter markers in the statement. The lower of the two numbers has been used.

    SQLWARN4 "W" indicates a singleton select that returns more than one row (only the first row is returned).