i know this waay but this would insert only one line but i wanted to
understand if there is a way to populate the complete set of records.
one way i know to acheive this is by writing while loop
to get each line (from axapta table) and then keep running the sql statement
to insert the record in the external table one by one. Now if in this
axapta table while contains 5 fields and there could be around 5000 records.
Is there any way i can populate the external table with these records in one
go.
Thanks,
Girish
-----Original Message-----
From: graver0206 [mailto:[EMAIL PROTECTED]
Sent: 26 July 2004 11:07
To: [EMAIL PROTECTED]
Subject: [development-axapta] Re: insert records SQL table outside axapta
Hi Girish.
The following code-extract inserts records into an external database
using a ODBC connection.
Regards,
S�ren Graversen
OdbcConnection OdbcCon;
str query1;
Statement S;
ResultSet R;
boolean updateOk;
LoginProperty LP = new LoginProperty();
str host = "pcsg2";
;
LP.setDSN("SGMYSQL");
LP.setServer(host);
LP.setUsername("Myadmin");
LP.setPassword("password");
OdbcCon = new OdbcConnection(LP);
// Insert package information
query1 = strfmt("INSERT INTO FodocWebDistTable (JournalId,
AuthId, PostedDate) VALUES ('%1', '%2', '%3')",
replQueue.JournalId,
authid,
date2Str(replQueue.createdDate,321,2,3,2,3,4),
);
if (OdbcCon)
{
S = OdbcCon.createStatement();
updateOk = S.executeUpdate(query1);
}
else
error("@FOC2129");
--- In [EMAIL PROTECTED], "Girish Bhatkal"
<[EMAIL PROTECTED]> wrote:
> 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 Sponsor
ADVERTISEMENT
----------------------------------------------------------------------------
--
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

