Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ExecuteSQL and Stored Procedure

Status
Not open for further replies.

JasonDBurke

Programmer
Joined
Jun 20, 2001
Messages
54
Location
US
Can somebody just give me example syntax to passing info during a ExecuteSQL...just 2 params would be good..first as an int and second a string.

//this is just very strange to me
{CALL proc-name [(? [, ?]...)]}

CDatabase DB;

DB.ExecuteSQL("{CALL insert_Alarm_Info_1 [(19 [, hello])]}");

hello should just be a string and 19 of course is an int.
 
DB.ExecuteSQL("{CALL insert_Alarm_Info_1 [(19 [, hello])]}");

instead of above try this...

execute insert_alarm_info_1 19,'hello'

make sure that your parameters are in the same order
in which they were created in the proc or else you will
get error messages.

Ex:

create proc insert_alarm_info_1
(
number int,
word varchar(20)
)

as

yada yada yada....


execute insert_alarm_info_1 'hello',19
--this will give an error message b/c its expecting
an int value as the first param but your sending a
varchar type.

hope this helps
annie100

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top