Chamando stored procedures
02
Apr
2008
Posted by: Ricardo Pichler in: X++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| static void storedProcedure(Args _args){
LogInProperty loginProp = new LogInProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
;
loginProp.setServer("Sever");
loginProp.setDatabase("DataBase");
loginProp.setUsername("bmssa");
loginProp.setPassword("*****");
try
{
myConnection = new OdbcConnection(loginProp);
}
catch
{
error("user name / password error");
return;
}
myStatement = myConnection.createStatement();
myResult = myStatement.executeQuery('EXEC [sp_CustOrderHist]');
while (myResult.next())
{
info(myResult.getString(1) + " " + myResult.getString(2));
}
} |
static void storedProcedure(Args _args){
LogInProperty loginProp = new LogInProperty();
OdbcConnection myConnection;
Statement myStatement;
ResultSet myResult;
;
loginProp.setServer("Sever");
loginProp.setDatabase("DataBase");
loginProp.setUsername("bmssa");
loginProp.setPassword("*****");
try
{
myConnection = new OdbcConnection(loginProp);
}
catch
{
error("user name / password error");
return;
}
myStatement = myConnection.createStatement();
myResult = myStatement.executeQuery('EXEC [sp_CustOrderHist]');
while (myResult.next())
{
info(myResult.getString(1) + " " + myResult.getString(2));
}
}
Leave a reply