Board index » jbuilder » Insert

Insert


2003-08-29 06:52:37 AM
jbuilder23
I am having trouble inserting rows using the JdbNavToolBar. The rows do not
save. Updates work just fine. What should I check?
 
 

Re:Insert

In <3f4e87b1$ XXXX@XXXXX.COM >Benjamin Toso wrote:
Quote
I am having trouble inserting rows using the JdbNavToolBar. The rows
do not save. Updates work just fine. What should I check?



Are you getting an error message..??? If so Post the stack trace..
FWIW.. You might have a situation where your StorageDataSet is not
reading the metadata correctly (a driver problem) and therefore DX does
not have the correct information to post a new record..
John..
--
+++++++++++++++++++++++
TeamB are volunteer helpers. Please do not email replies or questions.
Post or reply only on this newsgroup. Thank you.
For Papers on DataExpress, Applets, and Web Technologies go to:
www.microps.com/mps/papers.htm
=======================
 

Re:Insert

...this happened to have been my own error. For a different project, I had
sub-classed the QueryDataset, then overrode the saveChanges method at some
previous time for testing. I was using that same class.
"John B. Moore (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
In <3f4e87b1$ XXXX@XXXXX.COM >Benjamin Toso wrote:
>I am having trouble inserting rows using the JdbNavToolBar. The rows
>do not save. Updates work just fine. What should I check?
>
>
>

Are you getting an error message..??? If so Post the stack trace..

FWIW.. You might have a situation where your StorageDataSet is not
reading the metadata correctly (a driver problem) and therefore DX does
not have the correct information to post a new record..

John..
--
+++++++++++++++++++++++
TeamB are volunteer helpers. Please do not email replies or questions.
Post or reply only on this newsgroup. Thank you.
For Papers on DataExpress, Applets, and Web Technologies go to:
www.microps.com/mps/papers.htm
=======================
 

{smallsort}

Re:Insert

Hello
How can i insert data from one table to another with bulk insert without
using DTS ????
I'm using SqlServer2000 and Delphi6 SP2 RTL1 and Ado.
There is an command in SqlServer as Bulk Insert but it's copies from
datafile to table.
How did DTS copies directly data from one table to another ??? I want to
select the required data via AdoDataSet and then execute (some how ) bulk
insert this data to another table via TAdoConnection.
With normal insert into statements the perfonmance is very slow.
I'm meen something like "Insert into teble2 with bulk insert values ( bal
bla bla )" for each row
Any help,ideas ????
 

Re:Insert

Bulk insert are implemented with IRowsetFastLoad interface that is available
in MS SQL Server OLEDB provider (not available for other DBMS). However this
interface is not usable from ADO - you should connect to OLEDB provider
directly. To do this you may try OLEDB Direct (www.oledbdirect.com) -
it has an example "$(OLEDBDirect)\Examples\SQLServer\1 000 000 rows" that
shows how to bulk insert 1 000 000 rows into MS SQL Server table as fast as
up to 10 sec.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Stefanidis Dimitris" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях
следующе? news: XXXX@XXXXX.COM ...
Quote
Hello
How can i insert data from one table to another with bulk insert without
using DTS ????
I'm using SqlServer2000 and Delphi6 SP2 RTL1 and Ado.
There is an command in SqlServer as Bulk Insert but it's copies from
datafile to table.
How did DTS copies directly data from one table to another ??? I want to
select the required data via AdoDataSet and then execute (some how ) bulk
insert this data to another table via TAdoConnection.
With normal insert into statements the perfonmance is very slow.
I'm meen something like "Insert into teble2 with bulk insert values ( bal
bla bla )" for each row
Any help,ideas ????






 

Re:Insert

Thanks. I will try it
Dimitrsi
"Viatcheslav V. Vassiliev" < XXXX@XXXXX.COM >wrote in message
Quote
Bulk insert are implemented with IRowsetFastLoad interface that is
available
in MS SQL Server OLEDB provider (not available for other DBMS). However
this
interface is not usable from ADO - you should connect to OLEDB provider
directly. To do this you may try OLEDB Direct
(www.oledbdirect.com) -
it has an example "$(OLEDBDirect)\Examples\SQLServer\1 000 000 rows" that
shows how to bulk insert 1 000 000 rows into MS SQL Server table as fast
as
up to 10 sec.

//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Stefanidis Dimitris" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях
следующе? news: XXXX@XXXXX.COM ...
>Hello
>How can i insert data from one table to another with bulk insert without
>using DTS ????
>I'm using SqlServer2000 and Delphi6 SP2 RTL1 and Ado.
>There is an command in SqlServer as Bulk Insert but it's copies from
>datafile to table.
>How did DTS copies directly data from one table to another ??? I want to
>select the required data via AdoDataSet and then execute (some how )
bulk
>insert this data to another table via TAdoConnection.
>With normal insert into statements the perfonmance is very slow.
>I'm meen something like "Insert into teble2 with bulk insert values (
bal
>bla bla )" for each row
>Any help,ideas ????
>
>
>
>
>
>


 

Re:Insert

If both tables on the same server then you can issue SQL like this:
insert into table1 select * from table2
"Stefanidis Dimitris" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях
следующе? news: XXXX@XXXXX.COM ...
Quote
Hello
How can i insert data from one table to another with bulk insert without
using DTS ????
I'm using SqlServer2000 and Delphi6 SP2 RTL1 and Ado.
There is an command in SqlServer as Bulk Insert but it's copies from
datafile to table.
How did DTS copies directly data from one table to another ??? I want to
select the required data via AdoDataSet and then execute (some how ) bulk
insert this data to another table via TAdoConnection.
With normal insert into statements the perfonmance is very slow.
I'm meen something like "Insert into teble2 with bulk insert values ( bal
bla bla )" for each row
Any help,ideas ????






 

Re:Insert

"Stefanidis Dimitris" < XXXX@XXXXX.COM >wrote in message
Quote
Hello
How can i insert data from one table to another with bulk insert without
using DTS ????
Are you aware that you can automate DTS and control it from your Delphi
app??
 

Re:Insert

I use this method too but you must be aware that in this way the field
content is not copied following the field name but its internal
position in the table (the one that you can see by a SELECT *).
This means that if the two tables have not been created in the same
way (manual modifications, for example) you could try to insert a
string field into a numeric one or a numeric field into a numeric one
but not the same.
I discovered this in Oracle. I never tested in SqlServer but I suppose
it works in the same way.
Regards
Paolo
"Vitali Kalinin" < XXXX@XXXXX.COM >wrote in message
Quote
If both tables on the same server then you can issue SQL like this:
insert into table1 select * from table2
"Stefanidis Dimitris" < XXXX@XXXXX.COM >сообщи?сообщила ?
новостях
следующе? news: XXXX@XXXXX.COM ...
>Hello
>How can i insert data from one table to another with bulk insert
without
>using DTS ????
>I'm using SqlServer2000 and Delphi6 SP2 RTL1 and Ado.
>There is an command in SqlServer as Bulk Insert but it's copies
from
>datafile to table.
>How did DTS copies directly data from one table to another ??? I
want to
>select the required data via AdoDataSet and then execute (some
how ) bulk
>insert this data to another table via TAdoConnection.
>With normal insert into statements the perfonmance is very slow.
>I'm meen something like "Insert into teble2 with bulk insert
values ( bal
>bla bla )" for each row
>Any help,ideas ????
>
>
>
>
>
>


 

Re:Insert

IB 6.02
Could someone please correct below SQL.
INSERT INTO DETAIL ( RNO, ITEMNO, PARTNO, QTY, UPRICE )
VALUES (1, GEN_ID(DETAIL_ITEMNO,1),
(SELECT P.PARTNO, SUM(D.TRS + D.INCOME - D.OUTGO),
P.LASTPRICE FROM PARTS P
JOIN TEMP_DETAIL D ON D.PARTNO = P.PARTNO
WHERE P.CURR='Euro'
GROUP BY P.PARTNO, P.LASTPRICE
HAVING SUM(D.TRS + D.INCOME - D.OUTGO)>0)
Error Msg : Token Unknown Line 3 char 17 ,
Thank you.
 

Re:Insert

Henry wrote:
Quote
IB 6.02

Could someone please correct below SQL.

[...]
Try this instead:
INSERT INTO DETAIL ( RNO, ITEMNO, PARTNO, QTY, UPRICE )
SELECT 1, GEN_ID(DETAIL_ITEMNO,1),
P.PARTNO, SUM(D.TRS + D.INCOME - D.OUTGO),
P.LASTPRICE FROM PARTS P
JOIN TEMP_DETAIL D ON D.PARTNO = P.PARTNO
WHERE P.CURR='Euro'
GROUP BY P.PARTNO, P.LASTPRICE
HAVING SUM(D.TRS + D.INCOME - D.OUTGO)>0
--
Magnus
 

Re:Insert

Thank you Magnus,
This time i get Token unknown line 2 SELECT err.msg.
Quote
Try this instead:
INSERT INTO DETAIL ( RNO, ITEMNO, PARTNO, QTY, UPRICE )
SELECT 1, GEN_ID(DETAIL_ITEMNO,1),
P.PARTNO, SUM(D.TRS + D.INCOME - D.OUTGO),
P.LASTPRICE FROM PARTS P
JOIN TEMP_DETAIL D ON D.PARTNO = P.PARTNO
WHERE P.CURR='Euro'
GROUP BY P.PARTNO, P.LASTPRICE
HAVING SUM(D.TRS + D.INCOME - D.OUTGO)>0

--
Magnus
 

Re:Insert

Henry wrote:
Quote
Thank you Magnus,
This time i get Token unknown line 2 SELECT err.msg.

>Try this instead:

>INSERT INTO DETAIL ( RNO, ITEMNO, PARTNO, QTY, UPRICE )
>SELECT 1, GEN_ID(DETAIL_ITEMNO,1),
>P.PARTNO, SUM(D.TRS + D.INCOME - D.OUTGO),
>P.LASTPRICE FROM PARTS P
>JOIN TEMP_DETAIL D ON D.PARTNO = P.PARTNO
>WHERE P.CURR='Euro'
>GROUP BY P.PARTNO, P.LASTPRICE
>HAVING SUM(D.TRS + D.INCOME - D.OUTGO)>0
>
>-- Magnus
That SQL should work. Are you sure you are running that exact
statement? If you still get the error copy and paste the code you are
running into a message so we can see it.
--
Bill Todd (TeamB)
 

Re:Insert

IB 6.02
I have a BillOfMaterial Table ( PNO, LINENO, PNO2, QTY )
PNO=PK., and a Generator for LINENO
First i insert a new part no and applyupdates(0) then
i want to copy the details from another PartNo in the same table.
( Not to write 20, 30 records again )
Can somebody please correct below SQL for above operation.?
NewPno:='AAA'
CopyPno:='BBB'
INSERT INTO BOMATERIAL SELECT '+Edit1.Text+',
GEN_ID(BOMATERAIL_LINENO),PNO2, QTY
FROM BOMATERIAL WHERE PNO='+CopyPno;
Error:=Unknown Line1 Char62 ')'
Thank you
 

Re:Insert

Stan wrote:
Quote
INSERT INTO BOMATERIAL SELECT '+Edit1.Text+',
GEN_ID(BOMATERAIL_LINENO),PNO2, QTY
GEN_ID(BOMATERAIL_LINENO, 1),PNO2, QTY
Quote
FROM BOMATERIAL WHERE PNO='+CopyPno;

Error:=Unknown Line1 Char62 ')'

--
Magnus