Hi Girish,

you should use the OBDCconnection class for this.
Something like this:
static void Job7(Args _args)
{
    OdbcConnection  _OdbcConnection;
    LoginProperty   _LoginProperty =  new LoginProperty();
    Statement       _statement;
    ResultSet       _result;
    str             _sqlStr;
    ;
    _LoginProperty.setDSN("localserver");
    _LoginProperty.setDatabase("Pubs");
    _LoginProperty.setUsername("sa");
    _LoginProperty.setPassword("");
    try
    {
        _ODBCconnection = new OdbcConnection(_LoginProperty);
    }
    catch
    {
        throw error("Not connected");
    }
    _statement = _ODBCconnection.createStatement();
    _statement.executeUpdate("begin transaction");
    _sqlStr =  strfmt('INSERT INTO Jobs (job_desc, min_lvl, max_lvl) VALUES (\'Test Axapta\', 200, 244)');
    _statement.executeUpdate(_sqlStr);
    _statement.executeUpdate("commit transaction");
}



Mit freundlichen Gr��en / Best regards / Med venlig Hilsen
Jesper J�rgensen
Consulting
mailto: [EMAIL PROTECTED]
Aston Business Solutions GmbH
Kettelerstr. 3-11
D-97222 W�rzburg-Rimpar
Germany
Tel.   +49-9365-8075-0
Fax   +49-9365-8075-300
Work with a Winner. Aston Business Solutions--Microsoft Global Partner of The Year 2003 No one is more committed to your success than Aston Business Solutions. As the world's leading Microsoft Business Solutions partner, we maintain a 92% customer retention rate and count more than 5,000 distribution, manufacturing, healthcare, and service-based companies among our loyal clients. Learn how we can help you achieve your potential.
http://www.astongroup.de
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

-------- Original Message --------
Subject: [development-axapta] insert records  SQL table outside axapta (26-Jul-2004 11:55)
From:    [EMAIL PROTECTED]
To:      [EMAIL PROTECTED]

> Hi everyone,
>
>   whenever axapta needed to extract data from an SQL (on which axapta is
> not
> running) then we can get the data using the process of
> 1. initialise the connection to the external database (connect using ODBC)
> 2. run the SQL statement and get the executed query data in the resultset
> 3. now by using result.next() we get the records and update in the axapta
> table
>
>  similarly now if we want to run the opposite way i.e pickup the data
> (multiple records) from an axapta table and then insert these records in a
> table present in a database which is not running on axapta how to do this?
>           if anyone know how to achieve this please let me know.
>
> thanks
>
> Girish
>
>
>
>

> Yahoo! Groups Links
>
>
>

>
> To: [EMAIL PROTECTED]


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to