Z SQL method - how to get hold of the returning results
Heloo, I have a small problem - I don't how to get hold of the results from a Z SQL method. I have a method that returns a number to be inserted in my database. The code looks like this: SELECT 1+max(ordernum) AS next_num FROM playlistclips WHERE playlistid=<dtml-var showid> I have tested the code and it works. Now I need to insert the next_num in another method and I tried the following: <dtml-call expr="sqlAddClipToList(slcShowClips=slcShowClips,showid=showid,ordernumber=next_num)"> but I get an NameError: Error Value: next_num I thought that the first method returned a variable named next_num. -- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Gitte Wange said -
I have a method that returns a number to be inserted in my database. The code looks like this: SELECT 1+max(ordernum) AS next_num FROM playlistclips WHERE playlistid=<dtml-var showid>
I have tested the code and it works. Now I need to insert the next_num in another method and I tried the following: <dtml-call
expr="sqlAddClipToList(slcShowClips=slcShowClips,showid=showid,ordernumber=n ext_num)">
but I get an NameError: Error Value: next_num
I thought that the first method returned a variable named next_num.
The variable "next_num" is known to the query method, so you have to reference it to that. Something like this: The query method is called "query1" <dtml-in query1> <dtml-var next_id> </dtml-in> Tom P
participants (2)
-
Gitte Wange -
Thomas B. Passin