cancel
Showing results for 
Search instead for 
Did you mean: 

Delete from Table

Former Member
0 Kudos

Hi,

Can you please tell how to define the structure for "delete from dbtable;" without any conditions, which means without any key elements.

I tried without any key-elements, but it throws me a runtime exception "sax parse error". After that I tried using the whole DB table fields, but they should not be empty. But I cannot even pass values. So, how can I do that??.

Thanks in advance,

Raj.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you have the SQl with out the key element you will get a sax error. the only way to get around this is to specify key <> 0 .

Usually keys are never 0 and hence you can use this condition when deleting.

cheers,

Naveen

Former Member
0 Kudos

Naveen,

I understood you half, can you please explain me in more details.

Thanks-in-advance.

Raj.

Former Member
0 Kudos

Hi,

The table you want to delete should have a key say Account_Number.

delete *

from <ur table>

where account_number <> 0

this will delete all the records in ur table.

<root>

<XMLDelete>

<Table>

<Action> -


delete

<key>

<account_number> -


0

(attribute)<compareOperation> -


NEQ

cheers,

Naveen

Former Member
0 Kudos

Naveen,

Thanks. I defined like this, but getting Mapping error while activationg, "Mapping is not sufficoent".

I defined like this.

Delete Elemenet 1

zdiners Element 1

action attribute string optional

table Element string 1

key Element 1

EMP_NO Element string 0.

Thanks for the help.

Former Member
0 Kudos

Hi,

you missed <Access> and under it specify all the fields of the table.

Delete Elemenet 1

zdiners Element 1

action attribute string optional

table Element string 1

<access>

key Element 1

EMP_NO Element string 0.

cheers,

Naveen

Former Member
0 Kudos

Hi,

<root>

<Delete>

<Zdiners>

<action> -


delete

<table>

<key1>

<emp_no> --- 0

<compareOperation> --- NEQ

cheers,

Naveen

Former Member
0 Kudos

nAVEEN,

In the above reply you asked to write access, but in the later one u didnt. And I dont have any compare operation. And whats that NEQ(not equal to)...You mean to say that when emp_no is not equal to 0??.

First time doing, dont mind.

Thanks,

Raj.

Former Member
0 Kudos

Hi,

i got it wrong first time. you dont have to specify access as long as you are specifying the key. since u wnat to delete all the enteries in ur table, simply base ur delete on the condition that the key is not equal to zero.

include the comparision operation and test it.

cheers,

naveen

Former Member
0 Kudos

Naveen,

I already have, delete based on a condition that when a param value is x. now how can I have condition that key is not equal to zero. How can I have a map from my target to target?.

Can you please send me ur e-mail to: Peddisetty@gmail.com

Thanks-a-lot.

Raj.

Message was edited by: Raj

Answers (1)

Answers (1)

moorthy
Active Contributor
0 Kudos

HI Raj..

Did u try out with following blog-

Just refer it. may be useful.

/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

Regards,

Moorthy

Former Member
0 Kudos

Hi Moorthy,

Thanks. I have just downloaded the your BPM blog (I think its you). I think its excellent. Keep the great work.

Rgds,

Raj.