Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > DEM & Workflow

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th March 2011, 13:01
preethish preethish is offline
Member
 
Join Date: Oct 2010
Posts: 38
preethish is on a distinguished road
Baan: baan 4c4 and Lnfp2 - DB: sql - OS: windows2003
insert record
Baan: Other/Unknown

Hi,

I have to insert a record to a table in script.can Some one tell me how to do it.


Example. for a perticular consignment i have to insert a record to (max position +1) for tat consignment, I mean if xyz consingment is having 8 position under it. I have to insert a record to 9th position for the same consignment.

help me out.......

Preethish
Reply With Quote
  #2  
Old 29th April 2011, 08:48
alakananda12 alakananda12 is offline
Junior Member
 
Join Date: Dec 2009
Posts: 8
alakananda12 is on a distinguished road
Baan: BAAN IV - DB: SQLServer 2005 - OS: Windowsw Xp
Hi,

I am writing the dummy query for you

Taking the pono as position field and cono as consignment field.
-------------------------------------------------------------
select max(tablename.pono):max.pono
from tablename
where tabllename._index1 = {:tablename.cono}
selectdo
endselect

tablename.pono = max.pono + 1
|* assign the required values to insert in other fields as per your requirement
---------
------
db.insert(tablename,db.retry)

if e then
message("e=%d",e)
abort.transaction()
else
commit.transaction()
endif

-----------------------------------------------
Regards,
Alka
Reply With Quote
  #3  
Old 3rd May 2011, 12:28
darpan's Avatar
darpan darpan is offline
Senior Member
 
Join Date: Mar 2005
Location: Chennai
Posts: 114
darpan is on a distinguished road
Baan: Baan IV, Infor LN - DB: oracle 10g, Oracle 9i - OS: AIX, Windows server 2003
grt

hi Preetish,

The Query written by Alka is perfect one thing i noticed very few poeple use the exception code they usually belive that it will get inserted.



"
if e then
message("e=%d",e)
abort.transaction()
else
commit.transaction()
endif
"
Nice....

Best Regards

Darpan
Quote:
Originally Posted by alakananda12 View Post
Hi,

I am writing the dummy query for you

Taking the pono as position field and cono as consignment field.
-------------------------------------------------------------
select max(tablename.pono):max.pono
from tablename
where tabllename._index1 = {:tablename.cono}
selectdo
endselect

tablename.pono = max.pono + 1
|* assign the required values to insert in other fields as per your requirement
---------
------
db.insert(tablename,db.retry)

if e then
message("e=%d",e)
abort.transaction()
else
commit.transaction()
endif

-----------------------------------------------
Regards,
Alka
Reply With Quote
  #4  
Old 4th May 2011, 06:13
preethish preethish is offline
Member
 
Join Date: Oct 2010
Posts: 38
preethish is on a distinguished road
Baan: baan 4c4 and Lnfp2 - DB: sql - OS: windows2003
hi

Quote:
Originally Posted by alakananda12 View Post
Hi,

I am writing the dummy query for you

Taking the pono as position field and cono as consignment field.
-------------------------------------------------------------
select max(tablename.pono):max.pono
from tablename
where tabllename._index1 = {:tablename.cono}
selectdo
endselect

tablename.pono = max.pono + 1
|* assign the required values to insert in other fields as per your requirement
---------
------
db.insert(tablename,db.retry)

if e then
message("e=%d",e)
abort.transaction()
else
commit.transaction()
endif

-----------------------------------------------
Regards,
Alka
hi Alka,

Thanks for the help.

regards,
Preethish
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to insert record in baan table ncgjiju Tools Development 18 29th May 2009 11:52
Insert Record to a Table Dynamically Hiba_t Tools Development 6 8th April 2008 09:30
How to programatically insert a record VishalMistry Tools Development 5 17th November 2006 14:08
how to insert record in type3 form via AFS??? alibaba AFS/DDC/OLE: Function servers 5 17th September 2004 04:19


All times are GMT +2. The time now is 21:37.


©2001-2018 - Baanboard.com - Baanforums.com