## This is the file containing connection and other settings for ## sqlminus. ## this just helps to club various variables that belong to one target ## database. If we keep changing the database we connect to we need to ## make a change in one place only - this variable ## For me the values are home and office. U can have whatever values you ## want set connect_to home ## syntax of hook is: ## -hook command ## variable is anything you have set previously ## value is a perl regexp of value (for exact match use ^value$) ## command is any command that can be used here: set/abbr etc ## oracle (office) setup #connect_to-hook office set DSN jdbc:oracle:thin:@172.16.4.86:1521:ORCL connect_to-hook office set DSN jdbc:oracle:thin:@172.16.1.80:1521:LIVE connect_to-hook office set DRIVER oracle.jdbc.driver.OracleDriver connect_to-hook office set UID PMS connect_to-hook office set PWD PMS ## i specify the various connect strings _IN_ONE_LINE_- no wrapping as yet set meru_connector (jdbc:oracle:thin:@172.16.1.101:1521:airtel,oracle.jdbc.driver.OracleDriver,MERUUSER,MERU) set sys_connector (jdbc:oracle:thin:@172.16.1.101:1521:airtel,oracle.jdbc.driver.OracleDriver,SYSTEM,ORAUSER) set mysql_home_connector (jdbc:mysql://localhost/test,org.gjt.mm.mysql.Driver,root,root) set mysql_off_connector (jdbc:mysql://rahulk/test,org.gjt.mm.mysql.Driver,root,root) set pms_connector (jdbc:oracle:thin:@172.16.1.80:1521:LIVE,oracle.jdbc.driver.OracleDriver,PMS,PMS) set pms_sys_connector (jdbc:oracle:thin:@172.16.1.80:LIVE:airtel,oracle.jdbc.driver.OracleDriver,SYSTEM,MANAGER) ## these are the connect strings I would like to have in menu, so i can ## switch connections set connectors meru_connector,sys_connector,mysql_home_connector,mysql_off_connector,pms_connector,pms_sys_connector ## this is the connection i would like by default on startup unless ## something else is specified #set default_connector pms_connector #set default_connector meru_connector set default_connector mysql_home_connector ## MYSQL SETUP ## office mysql #set DSN jdbc:mysql://rahulk/test # home mysql connect_to-hook home set DSN jdbc:mysql://localhost/test connect_to-hook home set PWD root connect_to-hook home set UID root connect_to-hook home set DRIVER org.gjt.mm.mysql.Driver # abbr represents online expansions or substitutions #UID-hook : if logged in as this user, then expand a to abc # UID-hook MERUUSER abbr sol SOLUTIONS UID-hook MERUUSER abbr msol MU_SOLUTIONS UID-hook MERUUSER abbr msolr MU_SOLUTION_RULES UID-hook MERUUSER abbr mreg MU_REGISTRATION # the following abbrs are global (all users) abbr scount select count(*) from abbr sdist select distinct abbr selct select # syntax for saving contents of a tab to a file abbr help_save save (input|output|history|table) to filename # syntax for appending contents of a tab to a file abbr help_append append (input|output|history|table) to filename # syntax for readin contents of a file to a tab abbr help_read read (input|history) from filename abbr help help_read help_save help_append help_set abbr fixe fixedsql select '$tn', count(*) from $tn abbr rowsp rowsprocessed off abbr bm bookmark ## when pressing Construct button the input areas earlier contents will # clear, so that you can just press Run. #set constructclears on # whenever saving using 'save' always append to file, dont expect user # to explicitly say append # set alwaysappend on # alias represents context sensitive substitutes which occur during # processing. e.g in a select statement "select 1-3" could be # substituted with first 3 col names during processing. # color represents user defined foreground and background colors #color table blue white #color column green white #color keyword red white # cacheing of columns - enter % for all, or a commadelim list such as customer, # supplier,orders or sql patterns such as cust%, supp% etc #set columncaching Project,ProjectResource #set columncaching pos_ connect_to-hook home set columncaching % connect_to-hook office set columncaching % ## output should go to the Frames tab (multiple tables), or jtable ## (single) or text tab set outputformat jtable set tableview multiple #set outputformat text #set outputformat text|frame|jtable # initial capacity of StringBuffer allocated for entire sql result set resultinitialcapacity 1024 # initial capacity of StringBuffer allocated for each row set rowinitialcapacity 1024 #set spool out.txt ## keep running this as user clicks on tables #set fixedsql select '$tn', count(*) from $tn ## use this as column width on output tab #set colwidth 50 ## printing of column headers on OUTPUT tab #set header off ## printing of 'n rows processed' on OUTPUT tab #set rowsprocessed off ##change key bindings ## submit entire selection as one query, if no selection than current line #bind inputarea control-S submit-single # ## submit entire selection as multiple statements, one per line #bind inputarea control-Z submit-multiple ## save selection or entire window appending #bind . control-S save-to-defaultfile #bind . control-R read-from-defaultfile ## load from selected or else default file #bind . control-L load-from-defaultfile # example bindings as in javax.swing.KeyStroke getKeyStroke(String) # add a hyphen in place of space, character in UPPERCASE, except with # "typed" bind (table|frame) typed-o sort-action bind (table|frame) typed-O reversesort-action bind (table|frame) control-O inputsort-action bind (table|frame) typed-y remember-action bind (table|frame) typed-Y overwriteremember-action bind (table|frame) control-shift-Y clearselectedremember-action bind (table|frame) alt-shift-Y clearremember-action bind (table|frame) typed-? getlinkedinfo-action # search in table keys bind (table|frame) control-F search-action bind (table|frame) typed-/ search-action bind (table|frame) control-shift-F searchPartialMatchaction bind (table|frame) typed-R searchRegexMatchAction bind (table|frame) control-R searchRegexPartialMatchAction bind (table|frame) control-D next-Data bind (table|frame) control-B previous-Data ## when creating insert scripts what date/time function format to be ## used. Current interface is not friendly enough, but works. ## following are start and end portions of functions if target is Oracle ## if target is mysql nothing is needed DSN-hook oracle set fs_date TO_DATE('yyyy/MM/dd', DSN-hook oracle set fe_date ) DSN-hook oracle set fs_timestamp TO_DATE('yyyy/MM/dd hh:mi:ss', DSN-hook oracle set fe_timestamp ) #set fs_time TO_DATE('yyyy/MM/dd hh:mi:ss', #set fe_time ) # the following will get bookmarked into the Bookmarks menu connect_to-hook office bookmark expiry sql select * from MU_REGISTRATION a, MU_USER_PACKAGE b where a.userid=b.userid connect_to-hook home bookmark file1 file bm1.sql connect_to-hook home bookmark system1 system cat bm2.sql # specify the files to be displayed in the Bookmarks section for loading # on demand - these will not be read unless specifically asked for using # the "load" command. It is expected that these will be large. connect_to-hook office set bookmarks ora_create.xml,ora_cr1.xml,ora_tune.xml #connect_to-hook home link ProjectResource:ProjectCode:Project:ProjectCode:ProjectName #connect_to-hook home link ProjectResource:ResourceCode:Resource:ResourceCode:ResourceName #connect_to-hook home link Project:ClientCode:Client:ClientCode:ClientName:status = 'Y' #connect_to-hook home link Client:LocationCd:CodeSets:Code:Description:CodeSetName='LocationCd' connect_to-hook home link project:mgrempid:emp:empid:empname connect_to-hook home link project:deptcode:dept:deptcode:deptdesc connect_to-hook home link emp:deptcode:dept:deptcode:deptdesc connect_to-hook home link dept:headempid:emp:empid:empname sort Activity:ActivityCatCode,ActivityCode sort Client:ClientCode sort Project:ProjectCode sort ProjectResource:ProjectCode,ResourceCode # this is for oracle since getIndexInfo throws an SQLException for no # reason abbr indexinfo set fixedsql select a.table_name,b.column_name,a.index_type from user_indexes a, user_ind_columns b where a.table_name = '$tn' and a.index_name = b.index_name set buttonorient south #while autolinking a descriptive column will be matched with this regex #set desccolumn ([Dd]esc$|[Dd]escription$|[Nn]ame$) set desccolumn /(Desc$|Description$|Name$)/i