1.-, get all client variables from the CDATA
2.-then look for that variables like client.foo1.foo2
3.- delete client variables from the CDATA nad put it again without the
client.foo1.foo2 variables looks like.
<cfquery name="sel_client" datasource="cfvariables">
select * from cdata
where CFID = '#CFID#:#CFTOKEN#'
</cfquery>
<cfset tmp = listtoarray(sel_client.data,"##")>
<cfdump var="#tmp#" label="original">
<cfoutput>#arrayFind(tmp,"cotizacion.")#<br></cfoutput> <!--- here looking
for clients var like client.cotizacion.var1 ; client.cotizacion.var2 etc
--->
<cfscript>
while(arrayFind(tmp,"cotizacion.") neq 0)
{
writeoutput("encontre una cotizacion en la posicion
#arrayFind(tmp,"cotizacion.")#<br>");
arraydeleteat(tmp,arrayFind(tmp,"cotizacion."));
}
while(arrayFind(tmp,"contrato.") neq 0)
{
arraydeleteat(tmp,arrayFind(tmp,"contrato."));
}
</cfscript>
<cfdump var="#tmp#" label="without client.foo.foo1 variables look like">
<!--- this return an array truly without that vars -->
<cftry>
<cfquery name="del_client" datasource="cfvariables">
delete from dbo.cdata
where CFID = '#CFID#:#CFTOKEN#'
</cfquery>
<cfquery name="del_client" datasource="cfvariables">
delete from dbo.cglobal
where CFID = '#CFID#:#CFTOKEN#'
</cfquery>
<cfset tmp = arraytolist(tmp,"##")>
<cfquery name="add_client" datasource="cfvariables">
insert into dbo.cdata (CFID,APP,DATA)
VALUES('#CFID#:#CFTOKEN#','prueba','#tmp#')
</cfquery>
<cfcatch type="database">
<cfdump var="#cfcatch#">
<cfabort>
</cfcatch>
</cftry>
<cfquery name="lst_client" datasource="cfvariables">
select * from cdata
where CFID = '#CFID#:#CFTOKEN#'
</cfquery>
<cfdump var="#lst_client#" label="get the vars from CDATA again..">
And the f.... vars are still there...
:-S
i tried too deleteclientvariable("client.foo.foo2") but this dont delete it.
_____
De: Dave Carabetta [mailto:[EMAIL PROTECTED]
Enviado el: Viernes, 08 de Octubre de 2004 13:41
Para: CF-Talk
Asunto: Re: Urgent : problem with Client Variables.
On Fri, 8 Oct 2004 13:41:59 -0400, David Manriquez <[EMAIL PROTECTED]>
wrote:
> Hi there :
>
> please anyone solved this issue?
>
> I have clients variables that i want to delete but usign the
> deleteclientvariable or using a query to delete direct from
> the database ( where my clients vars are stored ) but the f... variable
is
> still there..
>
> variables like client.foo are deleted , but variables like
> client.contract.id can't
>
> anyone knows Why?
>
Can you share some code?
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]