• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Retrieve values

I am new to powerbuilder. i am having problems passing and Retrieving values.
How do i pass the values to the datawindow where my SQL resides.
IF there is more than one row(result) i want to do something else.

I created a DataWindow. The datawindow has a sql statement.
Example
SELECT test1, test2, test3 from product
   WHERE (test1 = :test1 ) AND  
         ( test2 = :test2 ) AND  
         ( test3 = :test3 )  
ORDER BY test3 DESC  


Now in my code
i am assigning the dataobject
DW.DataObject = 'DW_update' this is my datawindow name

Here i  am assigning the values for the sql statement the SQL gets three arguments
Test3="12/10/2008"
Test1=1
Test2= "cyto"

My question is how do i pass the values to the datawindow and if there are more than zero rows i want to do something else.

0
soorraj
Asked:
soorraj
  • 2
1 Solution
 
kotukunuiCommented:
long retval

retval=DW.retrieve( test1, test2 , test3 )

CHOOSE CASE retval
    CASE 0
        Do Something else // No rows returned
    CASE IS > 0
        Do Something // Greater than zero rows returned
    CASE IS < 0
        Error alert // Return value less than 0 is an error
END CHOOSE

Open in new window

0
 
kotukunuiCommented:
I'm assuming you have already assigned a transaction object to the datawindow control to connect it to the database e.g.

DW.SetTransObject(sqlca)

Open in new window

0
 
soorrajAuthor Commented:
Thanks it worked
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now