Can I put a wddx packet into a database and read it back out?

2000-05-17 Thread zknoll


I have an 2-D array of information that I convert into a wddx packet to
pass between templates but I would also like to be
able to store the packet into a database and read it out again. A) Is
this possible? B) Is it possible with access 200 as the
backend database? C) If A and B are true can you show me a snippet of
code as to how this would be done?

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Can I put a wddx packet into a database and read it back out?

2000-05-17 Thread Michael Paulsmeyer

Here you go...

In one template...
!--- create and populate your array ---
cfset myarray = arraynew()

cfset myarry[1] = "something"

!--- serialize array ---
CFWDDX INPUT="#myarray#" OUTPUT="Client.MyWDDX" ACTION="CFML2WDDX"

In the other template that you need to reference the array...
!--- deserialize array ---
CFWDDX INPUT="#Client.MyWDDX#" OUTPUT="myarray" ACTION="WDDX2CFML"

!--- Now you reference the array by name ---
cfoutput#myarray[1]#/cfoutput

I tested this with clientmanagement=yes in cfapplication tag and in cfserver
set a db for client variables, using MSAccess2000.

Mike.

-Original Message-
From: zknoll [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 17, 2000 9:12 AM
To: [EMAIL PROTECTED]
Subject: Can I put a wddx packet into a database and read it back out?



I have an 2-D array of information that I convert into a wddx packet to
pass between templates but I would also like to be
able to store the packet into a database and read it out again. A) Is
this possible? B) Is it possible with access 200 as the
backend database? C) If A and B are true can you show me a snippet of
code as to how this would be done?


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Can I put a wddx packet into a database and read it back out?

2000-05-17 Thread Stephen M. Aylor

Yes - depending on a few things

1. How long is the wddx packet/string after you serialize your 2D Array?

2. Will that fit into a Access text field or will you have to use memo?
either will work, depending on answer to #1.

Sure there's better, but here's something Im using:

cfwddx action="CFML2WDDX" input="#Your2dArray#" output="serialized2darray"

Here's the CFML Stored Proc snippet - do you need a snip of the actual sql
too?

Just a basic "insert into" statement should do it

cfstoredproc procedure="InsertWddx" datasource="YourDSN"
 cfprocparam
type="In"
cfsqltype="CF_SQL_CHAR"
dbvarname="wddx_packet"
value="#serialized2darray#"
maxlength="7000"
null="No"
/cfstoredproc

Steve

- Original Message -
From: zknoll [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 17, 2000 08:11 AM
Subject: Can I put a wddx packet into a database and read it back out?



 I have an 2-D array of information that I convert into a wddx packet to
 pass between templates but I would also like to be
 able to store the packet into a database and read it out again. A) Is
 this possible? B) Is it possible with access 200 as the
 backend database? C) If A and B are true can you show me a snippet of
 code as to how this would be done?

 --

 Archives: http://www.eGroups.com/list/cf-talk
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Can I put a wddx packet into a database and read it back out?

2000-05-17 Thread Sharon DiOrio

It is very possible.

!--- insert into database ---
cfwddx action="CFML2WDDX" input="myArray" output="myWDDX"
cfquery name="qInsWDDX" datasource="#APPLICATION.dsn#"
INSERT INTO Table (Wddx)
VALUES ('#myWDDX#')
/cfquery

!--- retrieve from database ---
cfquery name="qSelWDDX" datasource="#APPLICATION.dsn#"
SELECT WDDX
FROM Table
WHERE WddxID = #WDDXID#
/cfquery
cfwddx action="WDDX2CFML" input="#qSelWDDX.WDDX#" output="myArray"

It doesn't matter what database you're using because WDDX is just a text
string.

HTH

Sharon

At 11:11 AM 5/17/2000 -0400, zknoll wrote:

I have an 2-D array of information that I convert into a wddx packet to
pass between templates but I would also like to be
able to store the packet into a database and read it out again. A) Is
this possible? B) Is it possible with access 200 as the
backend database? C) If A and B are true can you show me a snippet of
code as to how this would be done?

---
---
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
 

--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.