Solved

about db2 store procedure

Posted on 2004-08-15
1
344 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
configuration management 2 99
Expand to include initial dialog with two choices. 9 59
Window placement 17 64
Not needed 13 53
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now