Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

about db2 store procedure

Posted on 2004-08-15
1
349 Views
Last Modified: 2013-11-20
i create a store procedure  in db2 ,it have two parameter :one is input ,the other is output,i dont know how to call this store procedure in visual c++!who can give some information ?thanks
0
Comment
Question by:fyf7262284
1 Comment
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 40 total points
ID: 11815315
Look at this sample of MSDN:

SQLUINTEGER PartID;
SQLINTEGER  PartIDInd = 0;

// Bind the parameter.
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0,
       &PartID, 0, PartIDInd);

// Place the department number in PartID.
PartID = 544;

// Execute the statement.
SQLExecDirect(hstmt, "{call PARTS_IN_ORDERS(?)}", SQL_NTS);

SQL_PARAM_INPUT_OUTPUT defines an argument that is input and output, while SQL_PARAM_OUTPUT defines the return value that must be declared like that:

   {?=call GetNextEmpID}

You may either use SQLPrepare + SQLExecute or SQLExecDirect to invoke Stored Procedures after defining the parametres by SQLBindParameter.

Regards, Alex
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 63
windows 10 how make picture as desktop background 2 65
matchUp  challenge 9 115
scoreUp challenge 14 63
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question