|
|
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
Вопрос следующий. Есть окошко, ему передается SQL запрос и результаты этого запроса выводятся в DW. DW инициализирую следующим образом Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2006, 14:34 |
|
||
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
1. В ls_query вместо параметров указать сразу их значения. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2006, 14:50 |
|
||
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
Дело в том что неизвестно сколько параметров и какие значени должны быть. В идеале их должен ввести оператор. Т.е. стандартными средствами никак? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2006, 15:40 |
|
||
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
Стандартными никак ;)))))) Варианты решения: 1) Присать все процедуры так чтоб не было обязательных параметров, а при вызвае без параметров процедура не ругалась а возвращала ResultSet. Ето сложно, но можно. Код: plaintext 1. 2. 3. 4. 5. 6. 7. Код: plaintext ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2006, 17:51 |
|
||
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
Chistyakov VictorЕсли запрос не содержит параметров то все нормально генерится. Но если там встречается параметр, то синтаксис не создается. Собственно вопрос: как вывести результат выполнения SQL запроса в DW, если запрос содержит параметры. Secrets of Dynamic DataWindows Undocumented PowerBuilder: As you know you can use SyntaxFromSQL function to generate DataWindow source code based on a SQL SELECT statement.Then you can pass the source code returned by SyntaxFromSQL directly to the Create function to create new datawindow dynamically. On-line helps says that for SyntaxFromSQL argument you can use only a string whose value is a valid SQL SELECT statement. However, in PowerBuilder 6.0 and above you can also use EXEC <procedure name> <parameters>, where you substitute <procedure name> with the actual stored procedure name and <parameters> with the actual parameter values instead of parameter names. For example, you can use NULL as a value for each required parameter. After you have the new datawindow created, you can use the Modify function to correct parameter names in the datawindow SQL. Link ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2006, 18:23 |
|
||
|
Создание DW с параметрами
|
|||
|---|---|---|---|
|
#18+
I use the following technique: 1) make SQL Select string in which arguments (eg. ":rs_id", ":rdt_start_date") are replaced with some constant value (eg. " ' ' ", "SYSDATE") which would be successfully interpreted by the DBMS for which DW is to be created. This way Select statement won't contain any arguments. 2) use SyntaxFromSQL to create DW syntax for this SQL Select statement 3) parse the generated syntax string and locate "table(" section in it. 4) replace "retrieve=" part of this "table(" section with the original SQL Select statement (with the arguments). 5) add new tag "arguments=" within the "table(" section, after "retrieve=" part with description of argument names and types. For the exact syntax you can investigate some DWs exported to SRD-files. 6) pass the modified syntax string (with replaced SQL Select and added arguments definitions) to the final Create statement. Of course these steps require some programming and experiments, but it works in our commercial products! So programmers, you have a serious material for the long nights :-) There are additional issues regarding object naming in dynamically generated DWs - sometimes header text objects' names don't match the corresponding column names below them (plus suffix "_t"). This happens with some (not all) SQL Select statements containing selection of equally named columns more than 1 times. So additional modification of the names in the syntax string can be performed in order to clean this mess. I hope that this gives some light on the topic. Wish you good luck! Ivaylo Ivanov Senior Software Developer BULGARIA ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.03.2006, 13:28 |
|
||
|
|

start [/forum/topic.php?fid=15&fpage=74&tid=1337879]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
36ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
37ms |
get tp. blocked users: |
2ms |
| others: | 248ms |
| total: | 365ms |

| 0 / 0 |
