Skip to main content

I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

I recall being told that you can use the U2 SQL functionality to update (insert/delete) items in a file. I haven't done it myself, so I can't really guide you. Maybe you have to define the file for SQL usage first - or maybe you don't.

Or: QM has this functionality built in. You can find the source code of the UPDATE.RECORD command by Googling for it (search for: openqm gpl.bp) then look at the UPDREC item in the GPL.BP folder.

Cheers,

Brian


I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

Universe has a version of UPDATE.RECORD ported from PI/Open (I think) the source code is in APP.PROGS UPDATE.REC.B. It needs cataloging as UPDATE.RECORD, you can then do UPDATE.RECORD -HELP . We use this all the time for exactly this purpose. 


I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

Hi Ian,

hopefully I've got a gist of what you want to do

This is a simple VOC paragraph (AM.UPDATE.VOC) that will create a new VOC paragraph

The new VOC entry (I've called it VOC.UPDATE)  that would be overwritten every time its run, you would need to set the syntax for the command you want to execute in rows 15,16,17 in front of the user entered path

AM.UPDATE.VOC
0001: PA
0002: CS
0003: DISPLAY
0004: DISPLAY ENTER FIRST PATH <<ENTER FIRST PATH>>
0005: DISPLAY
0006: DISPLAY ENTER SECOND PATH <<ENTER SECOND PATH>>
0007: DISPLAY
0008: DISPLAY ENTER THIRD PATH <<ENTER THIRD PATH>>
0009: DISPLAY
0010: HUSH ON
0011: ED VOC VOC.UPDATE
0012: DATA D9999
0013: DATA I
0014: DATA PA
0015: DATA  {insert command syntax in here}  <<ENTER FIRST PATH>>
0016: DATA  {insert command syntax in here}  <<ENTER SECOND PATH>>
0017: DATA  {insert command syntax in here}  <<ENTER THIRD PATH>>
0018: DATA
0019: DATA FI
0020: HUSH OFF
0021: DISPLAY
0022: DISPLAY NOW RUN VOC.UPDATE
0023: DISPLAY
0024: DISPLAY <<PRESS RETURN TO CONTINUE>>
0025: DISPLAY
0026: DISPLAY

you could also get the above paragraph to run  the newly updated VOC.UPDATE

I'm sure you will get the idea and can adapt to suit your needs

I hope this helps

Thanks

Andy


I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

This is quite easy using the SQL command "UPDATE" or "INSERT" commands.

The following will update the existing VOC item INVOICE.EXTRACTS

UPDATE "VOC" SET INV.PATH = '/path/to/invoices' WHERE @ID = 'INVOICE.EXTRACTS';
UPDATE "VOC" SET INV.PATH2 = '/path/to/invoices2' WHERE @ID = 'INVOICE.EXTRACTS';
UPDATE "VOC" SET INV.PATH3 = '/path/to/invoices2' WHERE @ID = 'INVOICE.EXTRACTS';

The following will CREATE the VOC item INVOICE.EXTRACTS:

INSERT INTO VOC (@ID, F1, F2, F3, F4) VALUES ('INVOICE.EXTRACTS','X','/path/to/invoices','/path/to/invoices2','/path/to/invoices3');

This is what the INSERT command produces:

>INSERT INTO VOC (@ID, F1, F2, F3, F4) VALUES ('INVOICE.EXTRACTS','X','/path/to/
invoices','/path/to/invoices2','/path/to/invoices3');
UniVerse/SQL: 1 record inserted.
>CT VOC 'INVOICE.EXTRACTS'

     INVOICE.EXTRACTS
0001 X
0002 /path/to/invoices
0003 /path/to/invoices2
0004 /path/to/invoices3
>

Both commands are documented in the "SQL Reference" manual.

The hurdle for understanding is that any UV file can be used with these commands, not just SQL Tables or Views.


I'm working on something to make deployments to new environments a little easier, and one thing that would be super helpful is the ability to create or update VOC items from a script of some kind (e.g. a PAragraph).  I could of course do it from a basic program, but then the person doing the process would have to know how to save the program to the appropriate place, compile and catalog, and then run the program.  The idea is to give them a script and after saving it as a PA in the VOC, have them run it and it will take care of all the heavy lifting after that.  Most things I can do (creating directories, compiling programs, etc) but can't find a command that will allow you to update a file directly from TCL.  Anyone got any suggestions on a command?  I've got to be missing something obvious that will do this.

PA

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH='/path/to/invoices'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH2='/path/to/invoices2'

UPDATE VOC INVOICE.EXTRACTS SET INV.PATH3='/path/to/invoices3'

HI,

The good method with uvSQL  INSERT INTO VOC (@ID,F1,F2,F3) VALUES ('filename','F','osfilename or osfullpath','osdictfilename or osfullpath');

Dicts F1 F2 F3 ... F10  are delivered to each VOC  from NEWACC,flavor definitions,  used at account creation or when UPDATE.ACCOUNT is executed.

To create remote pointers, it's better to use : 

(set a Q-pointer) SET.FILE [account] [filename] [pointer]

(set a F-pointer) SETFILE [pathname] [filename] [OVERWRITING]

I suggest you look at CLEAN.ACCOUNT.  After checking VOC file defn availability, It'll fix all missed os local file VOC entry.  

I hope this help 

manufv