on 2012 May 25 1:58 AM
Hi Experts,
I have a table with one columne with few rows. I want to print all the rows in BODS using print function. I used as below , but its printing only the first row from the the oracle table and does not print the rest of the rows. What settings i need to change in order to print all the rows.
print(sql('DSSTAGING', 'select col from test_error '));
Appreiate your help..
Thanks,
narayanan
Request clarification before answering.
Hi Narayanan,
You won't be able to use one print function to list multiple rows, but there is a way to work around this problem that will help you achieve what you want. The following method or similar may not be practical if you have many rows .
If you have one column with 5 rows containg random data for example you can use TOP is sql in multiple print within a script, for example:
$GlobalVariable0=Print (sql('DSSTAGING', 'SELECT TOP 1 Col FROM test_error ORDER BY ID'));
$GlobalVariable0=Print (sql('DSSTAGING', 'SELECT TOP 1 Col FROM test_error WHERE ID NOT IN ( SELECT TOP 1 ID FROM test_error ORDER BY ID )ORDER BY ID'));
$GlobalVariable0=Print (sql('DSSTAGING', 'SELECT TOP 1 Col FROM test_error WHERE ID NOT IN ( SELECT TOP 2 ID FROM test_error ORDER BY ID )ORDER BY ID'));
$GlobalVariable0=Print (sql('DSSTAGING', 'SELECT TOP 1 Col FROM test_error WHERE ID NOT IN ( SELECT TOP 3 ID FROM test_error ORDER BY ID )ORDER BY ID'));
$GlobalVariable0=Print (sql('DSSTAGING', 'SELECT TOP 1 Col FROM test_error WHERE ID NOT IN ( SELECT TOP 4 ID FROM test_error ORDER BY ID )ORDER BY ID'));
You'll achieve this result:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.