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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:07:42+00:00 2026-06-11T12:07:42+00:00

I have written following piece of code in C: EXEC SQL begin declare section;

  • 0

I have written following piece of code in C:

EXEC SQL begin declare section;
    int     A;
    char    B[5];
    int     C;
    int     D;
    dtime_t E;
    char    F[13];
EXEC SQL END DECLARE SECTION;
char E_dt[16];
D=0;
memset(F, 0, sizeof(F));          

EXEC SQL declare log3 cursor for select A, B, C, D, E, F from tbl WHERE C=123;
if(sqlca.sqlcode) 
{
    return;
}

EXEC SQL fetch log3
    into
     :A, :B, :C, :D, :E, :F, 
if(sqlca.sqlcode) 
{
    if (sqlca.sqlcode != DB_NORECORDS) 
    {
        return;
    }
    break;
}

When we run this piece of code, where the value of F is Null in the table tbl. It gives error code 1405. I have tried memset function for setting its default value as 0. But it did not work. And one more thing can i fetch more than 90 field at a time, when i was trying to do that it gives me Bus Error at the time of compilation. Thanks in advance please help me out.

  • 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-06-11T12:07:43+00:00Added an answer on June 11, 2026 at 12:07 pm

    You have 2 basic options:

    1. Use an indicator to record the presence of the NULL. You probably should use this option when you want a specific action to be taken when a NULL arises.
    2. Use the NVL function to convert the retrieved NULL to another value, such as zero or blank. This is the simplest solution.

    Edit:

    Example with NVL for log3 cursor. Choose whatever default values you want. In the example I have used ‘ ‘ for character fields, 0 for numeric fields and Jan 1st year 1 for dates.

    EXEC SQL declare log3 cursor for select NVL(A, 0), 
                                            NVL(B, ' '), 
                                            NVL(C, 0), 
                                            NVL(D, 0), 
                                            NVL(E, to_date('0001', 'YYYY')),
                                            NVL(F, ' ')
                                       from tbl 
                                      WHERE C=123;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written the following piece of code ( sql clr stored procedure )
I have written the following piece of code if( (!isset($_SESSION['home'])) || (!isset($_SESSION['away'])) ) I
I have the following piece of code. This is written for getting the list
I have written the following piece of code, all i want to do is
I have written the following piece of code that reads through a given xml-file
I have the following piece of code $j('#singleDeviceMac').val().replace(/:/,); this piece of code is written
I have written the following piece of code in my view page <script type=text/javascript>
I have written following code to attach gesture recogniser to multiple imageviews. [imageview1 setUserInteractionEnabled:YES];
I am trying my hands on WPF MVVM. I have written following code in
i have written the following code class Program { static void Main(string[] args) {

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.