MAX wrote:
I thought that oracle's sqlplus sucked, now I found worse,
my understanding is that for sapdb (on linux), you need 3 command line tools :


i) repmcli for stored creation,

ii) dbmcli for table, sequences, and index creation

iii) ireport.py for typing sql commands

repmcli/loadercli is for batch SQL and masss loading of data.


dbmcli is for administrative purposes only. Although it can execute sql commands, this was added more as a convenience feature of the developers than as an offcial feature.

- ireport.py :
q1 : is it possible to paste a multiline statement in an ireport.py console ?

You could execute the command edit, this opens an empty editor. After saving and closing the editor, the content of the file is executed as an SQL statement.


q2 : can a file be loaded in ireport.py ?

Should be easy to add: - go to class InteractiveReport - add a method def do_runfile (sself, strarg = None) - add a string as the first line, this is used by the help system - open the file, break it into commands and execute them using do_sql - see the other do_* methods for examples

It would be really nice to be able to do all above tasks from ireport.py...

Ah, before I forget :

  is there the equivalent of a create OR REPLACE store proc ?
 or "if stored proc X exists then drop proc X ?

My suggestion: write your own tool exactly to your liking:
- start with the option parsing and connecting of ireport
- write some code to read a file and break it into individual SQL commands, keep a count of the line number for error reporting
- execute the SQL, possibly catching any errors
- depending on your needs, you could choose to ignore certain errors like 'DBProc does not exist'. This way you could have a DROP DBPROC before every CREATE DBPROC. Of course, you could also look at the start of each command and construct the DROP yourself whenever a CREATE DBPROC is found
- look at the *.py files in <dependent_path>/env for some complex installation scripts.



Daniel Dittmar


--
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org


_______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to