Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
26%
500 - 800 GB
3%
800 - 1200 GB
9%
1200 - 1500 GB
12%
1500 - 2000 GB
12%
> 2000 GB
21%
Total votes: 34

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 2nd May 2006, 16:31
tab0529's Avatar
tab0529 tab0529 is offline
Junior Member
 
Join Date: Feb 2003
Location: Tiffin, OH, USA
Posts: 25
tab0529 is on a distinguished road
Baan: B50c - DB: Oracle 9.2.0.5 - OS: AIX 5.1
text.delete gives error -1

Hello,

I am trying to delete text as I am deleting rows from a table. The record gets deleted OK, but the text.delete gives an error -1. Since I have never coded text.delete before, perhaps there is something wrong with my code, which is attached.

Does anyone see any problems with my code?

Thanks in advance for your help!

Code:
	select	tsclm900.*
	from	tsclm900
	for update
	where	tsclm900.cnum = :tsclm913.cnum
	selectdo
		txt2 = tsclm900.txta
		lrtn.clm900 = db.delete(ttsclm900,db.retry)
		if lrtn.clm900 <> 0 then
			abort.transaction()
		else
			commit.transaction()
		endif
		if txt2 > 0 then
			lrtn = text.delete("txt2", "")
			if lrtn <> 0 then
				abort.transaction()
			else
				commit.transaction()
			endif
		endif
	endselect

Last edited by mark_h : 2nd May 2006 at 17:39. Reason: include code in post.
Reply With Quote
  #2  
Old 2nd May 2006, 17:08
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
-1 is a syntax error. Not sure, but did you try to insert the tablefield instead of your variable? (before deleting the record. Delete the record only, if you could successfully delete the text. If something crashes, it is much easier to remove a record then a text)

hth

Regards
csegcn
Reply With Quote
  #3  
Old 2nd May 2006, 17:32
norwim's Avatar
norwim norwim is offline
Guru
 
Join Date: Oct 2001
Location: Germany Moenchengladbach
Posts: 450
norwim is on a distinguished road
Baan: some - DB: more - OS: many
Hi there,

from Tools Help:

long TEXT.DELETE ( string text_field(17),
string lang )
according to your sniplet you put a long where a string should have been.
And I agree absolutely with csecgn that you should reverse the order of the deletions.
result=text.delete("tsclm900.txta","3") for a german text should be correct.

good luck

Norbert
__________________
Have a nice day
Reply With Quote
Sponsored Links
  #4  
Old 2nd May 2006, 23:10
tab0529's Avatar
tab0529 tab0529 is offline
Junior Member
 
Join Date: Feb 2003
Location: Tiffin, OH, USA
Posts: 25
tab0529 is on a distinguished road
Baan: B50c - DB: Oracle 9.2.0.5 - OS: AIX 5.1
text.delete gives error -1

Hello Norbert,

I moved the if txt2 > 0 ... endif to between txt2 = tsclm900.txta and lrtn.clm900 = db.delete(ttsclm900,db.retry) and I still get the -1 error. I am not sure if there is a problem with txt2 field or not. txt2 is defined in script as extern domain tctxtn. Also, I am using txt2 elsewhere in the script as the text_field_to argument of text.copy.between.companies command without syntax or execution errors. Any other ideas I might try? Is there any other source of better documentation for Baan commands with examples?

Thanks again,
Reply With Quote
  #5  
Old 3rd May 2006, 08:35
norwim's Avatar
norwim norwim is offline
Guru
 
Join Date: Oct 2001
Location: Germany Moenchengladbach
Posts: 450
norwim is on a distinguished road
Baan: some - DB: more - OS: many
Hi there,

please reread my posting ...

--sniplett of a working program ---
if fd(1)>0 then
kw1="Kundennummer"
text.rewrite("tccom010.txta","3",kw1,kw2,kw3,kw4,"kuntext","","/home
/wimmer/txttemp1")
else
text.delete("tccom010.txta","3")
tccom010.txta=0
--snap

hth

Norbert
__________________
Have a nice day
Reply With Quote
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
text.delete() spartacus Tools Development 5 31st July 2003 11:08


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


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