Axapta’dan Store Procedure Çağırma

Merhaba
Axapta’dan Store Procedure Çağırma şu şekilde yapılabilir.
static void storedProcedure(Args _args)
{
    LogInProperty Lp = new LogInProperty();
    OdbcConnection myConnection;
    Statement myStatement;
    ResultSet myResult;
    ;
    LP.setServer(‘SeverName’);
    LP.setDatabase(‘DataBaseName’);
    Lp.setUsername(‘sa’);
    Lp.setPassword(‘sa’);

    try
    {
        myConnection = new OdbcConnection(LP);
    }
    catch
    {
        info(‘Check username/password.’);
        return;
    }

    myStatement = myConnection.createStatement();
    myResult = myStatement.executeQuery(‘EXEC [inventtablesp]‘);//stored procedure name
    while (myResult.next())
    {
        print myResult.getString(1);
    }
    pause;
}

 
 
Comment are closed.