HighDots Forums  

pass SQL to variable

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss pass SQL to variable in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-D-
 
Posts: n/a

Default pass SQL to variable - 08-01-2004 , 11:47 PM






When defining a recordset and writing a SQL statement in the advanced dialog
in DMX, is there a way to pass the SQL statement to a variable? If so, how?
Thanks.
-D-



Reply With Quote
  #2  
Old   
-D-
 
Posts: n/a

Default Re: pass SQL to variable - 08-02-2004 , 09:28 AM






I thought my previous question might be unclear. So, to re-phrase my
question, does DMX have the capability to define a variable like:

Dim strSQL

and set the variable equal to a SQL statement?

Dim strSQL = "SELECT field1 From tbl1 Where Record1 = '" &
Session("Record1") & "';"

I haven't been able to figure this out in DMX? Is there a way to do this?
Thanks for any input.
-D-



"-D-" <noone (AT) nospam (DOT) com> wrote

Quote:
When defining a recordset and writing a SQL statement in the advanced
dialog
in DMX, is there a way to pass the SQL statement to a variable? If so,
how?
Thanks.
-D-





Reply With Quote
  #3  
Old   
cmbergin
 
Posts: n/a

Default Re: pass SQL to variable - 08-02-2004 , 09:58 AM



Open the page up in code view. You can sling that SQL string around wherever you want it.
Ex:

Dim myVar
myVar = recorset.Source

Reply With Quote
  #4  
Old   
cmbergin
 
Posts: n/a

Default Re: pass SQL to variable - 08-02-2004 , 10:15 AM



Same answer-- you can do anything you want in code view. Just don't expect the UI to do it for you.

Reply With Quote
  #5  
Old   
-D-
 
Posts: n/a

Default Re: pass SQL to variable - 08-02-2004 , 11:21 AM



Thanks for the reply. I was trying to see if there was a way to use the DMX
interface to write the SQL to a variable, but it appears from your answer that
I would just write the statement directly into the code.

Or, is it possible to write a new server behavior as listed in the server
behavior panel? And then insert the statement into the code that way?

-D-


Reply With Quote
  #6  
Old   
cmbergin
 
Posts: n/a

Default Re: pass SQL to variable - 08-02-2004 , 12:09 PM



I know you can write your own server behaviors, but I've never done it. I
assume you can make your server behaviors do anything you want, including
storing the SQL statement in a variable before using it. After all, MMs server
behaviors create variables for each parameter, so why not?

I'll bet writing your own server behavior is the way to go.


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.