delete recods()

2 views
Skip to first unread message

salvatore fusto

unread,
Sep 9, 2010, 10:16:21 AM9/9/10
to DataMgr
I've a problem with the deleteRecords(tablename,data): looking at code
it is:
<cfset var qRecords = getRecords(arguments.tablename,arguments.data)>
<cfset var out = StructNew()>
<cfoutput query="qRecords">
<cfset out = QueryRowToStruct(qRecords,CurrentRow)>
<cfset deleteRecord(arguments.tablename,out)>
</cfoutput>
but this way it does not work.
i changed:
<cfset var qRecords = getRecords(arguments.tablename,arguments.data)>
<cfset var out = StructNew()>
<cfoutput query="qRecords">
<cfset out["id"]=qRecords["id"][currentRow]>
<cfset deleteRecord(arguments.tablename,out)>
</cfoutput>

leaving only the primary key in the data structure, and it works fine:
what do you think about?
regards
salvatore

Steve Bryant

unread,
Sep 9, 2010, 11:02:28 PM9/9/10
to dat...@googlegroups.com
Salvatore,

I have to confess that it has been a long time since I have passed in
a structure with other keys besides the primary key.

Which version of DataMgr were you using?

Thanks,

Steve

> --
> You received this message because you are subscribed to the Google Groups "DataMgr" group.
> To post to this group, send email to dat...@googlegroups.com.
> To unsubscribe from this group, send email to datamgr+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/datamgr?hl=en.
>
>

Kym Kovan

unread,
Sep 10, 2010, 1:03:01 AM9/10/10
to dat...@googlegroups.com
On 10/09/2010 13:02, Steve Bryant wrote:
> Salvatore,
>
> I have to confess that it has been a long time since I have passed in
> a structure with other keys besides the primary key.

We do it a lot, and bumped into a similar problem some months back IIRC.
We had to revert to a <cfquery with real SQL! :-)


--

Yours, Kym

salvatore fusto

unread,
Sep 10, 2010, 3:50:39 AM9/10/10
to DataMgr
Steve,
dataMgr 2.2.02
primary key is all is needed to delete a record: the more the keys
are, the more you can have a value in the data struct slightly
different fron the corrisponding field in the table.

regards
salvatore


On 10 Set, 05:02, Steve Bryant <sebto...@gmail.com> wrote:
> Salvatore,
>
> I have to confess that it has been a long time since I have passed in
> a structure with other keys besides the primary key.
>
> Which version of DataMgr were you using?
>
> Thanks,
>
> Steve
>

salvatore fusto

unread,
Sep 10, 2010, 3:51:52 AM9/10/10
to DataMgr
Kym,
In dataMgr you can use sql statement: imho the best way is to use the
advsql structure, or use the runSql() method.
have a look to doc.

Regards
Salvatore

Kym Kovan

unread,
Sep 10, 2010, 4:08:27 AM9/10/10
to dat...@googlegroups.com
On 10/09/2010 17:51, salvatore fusto wrote:
> Kym,
> In dataMgr you can use sql statement: imho the best way is to use the
> advsql structure, or use the runSql() method.

I can't recall what the issue was back then but it must have been very
specific as we use both advsql and runSQL() a lot.

> have a look to doc.

Don't worry, we do :-)

--

Yours,

Kym

Steve Bryant

unread,
Sep 10, 2010, 10:28:55 AM9/10/10
to dat...@googlegroups.com
OK. I will get this fixed, hopefully by the next build.

Sorry for the trouble on this,

Steve

salvatore fusto

unread,
Sep 10, 2010, 11:58:53 AM9/10/10
to DataMgr
do'nt worry Steve.
thanks and regards
Salvatore

On 10 Set, 16:28, Steve Bryant <sebto...@gmail.com> wrote:
> OK. I will get this fixed, hopefully by the next build.
>
> Sorry for the trouble on this,
>
> Steve
>
Reply all
Reply to author
Forward
0 new messages