jboyce
Forum Replies Created
-
In Delphi you could create two variables Part and Desc and use the Copy, Pos and Length functions to split the variable Part_Desc with these two statements:
Part := Copy(Part_Desc, 1, Pos(‘ ‘, Part_Desc)-1);
Desc := Copy(Part_Desc, Pos(‘ ‘, Part_Desc)+1, Length(Part_Desc)-Pos(‘ ‘, Part_Desc));
This will split it based on the first space.
-
Alex,
When you open stockmarket.aero you are connecting through the Internet to wherever Component Control houses the stock market database. You might want to look at firewalls or other security software that may be affecting the connection.
-
It can be done. How depends on what type of Image Server(s) you have. Are you using the original image servers, or the newer encrypted image servers?
-
The problem with auto logging off users is that the Quantum client constantly communicates with Oracle, so even if your users have gone home it looks to Oracle that they are active. Therefore, Oracle idle time never goes beyond 1 minute. We have written a Windows service that kills users that have been disconnected (computer crashed, rebooted, etc. with Quantum running). In those cases Quantum can use up a license even after it’s been disconnected because then the Oracle idle timer increases. I made it available to the Que Group a while ago. It comes with no warranties and you will need someone who is familar with installing and running Windows services.
The other option you have is to kill all users that have been connected for a period of time. For example kill all users at 3:00 am if they have been logged on for more than 8 hours and just left their Quantum session running overnight.
-
Try this query:
Select cmp.company_name, cmp.company_code, tmc.term_code as cust_terms, tmc2.term_code as vend_terms
from companies cmp join term_codes tmc on tmc.tmc_auto_key = cmp.tmc_auto_key
join term_codes tmc2 on tmc2.tmc_auto_key = cmp.tmc_vend_override
-
You PO and RO are often mutually exclusive. You could link both to the RC_HEADER table with a Union clause.
For example:
Select roh.roh_auto_key, rch.rch_auto_key
from ro_header roh join rc_header rch on roh.roh_auto_key = rch.roh_auto_key
Union
Select poh.poh_auto_key, rch.rch_auto_key
from po_header poh join rc_header rch on poh.poh_auto_key = rch.roh_auto_key;
-
We use Oracle consultants for these type of issues (they are not Quantum experts). If you want to send me your contact info I can have them call you.
John Boyce (jboyce@ansett.com)
-
Depends what you mean by combine, but Oracle definitely allows querying across schemas as long as you have permission (via the Grant command) for all of the areas you want to Query (or any other command such as Insert, Update or Delete).
For example:
Select a.column1, b.column2
From schema1.table1 a join schema2.table2 b on a.key = b.key;
Again the key is having the correct privileges for both schemas as Quantum schema creates by default only grant privileges to the owning schema.
-
Over the years we have found various and numerous issues when merging and using the option “Merge and set to inactive”, but virtually no problems when the option is “Merge and delete”. Of course the old part is then gone from the database, so you need to make sure you have it right, because there is no reversing the process.
-
Also, you can read or write images to the old server, even though it is not designated as the default in the Image_Server table. All images pointers are still kept in the Image_List table. You designate which are on which server by the IMS_AUTO_KEY which links to the correct server in the Image_Server table.
The “Amazon” type server uses a field in Image_List called Image_GUID to connect to the images. This will be null for images in the old “Quantum” type server. -
Jesse, we’re on version 12.2 and using both the old and new image server technologies. We also have written our own software to add images and are able to continue to add images to the old “Quantum” type image server with our programs. All images added directly from within Quantum are added to the new encrypted “Amazon” type server, which is set as the default.
To read from the “Amazon” type server you need the Quantum GraphQL API, which can be purchased from CC. You can check with them for pricing. You would then have to modify your programs to use the API. We haven’t done this yet, as we are currently more interested in adding images in bulk fashion outside of Quantum. -
Craig, as long as the output from the two queries are the same (i.e. the same number out output fields) and in the same order you can use the UNION operator to combine the two queries into one. With some slight modification of the order of the fields in your select statement it looks like it would work in your example.
-
Yes, the procedure I provided does not to the opposite and approve vendors. We have a separate program run by the our vendor manager to turn vendors on.
Mike’s Forms Designer approach is a good one as well.
Just want to emphasize that you don’t need Event Manager to schedule events. The Oracle database contains all of the functionality through its Scheduler system. In fact, the Quantum’s Event Manager is a fancy wrapper of the functionality of the Oracle Scheduler that has some significant advantages (pretty formatted emails, for example) that otherwise would be difficult to do. But for executing PL/SQL procedures, using the Oracle scheduler functionality is simple and flexible.
We have the Event Manager and use both it and the Oracle Scheduler depending on the specific need.
-
The case statement in Object Pascal requires and ordinal value (think Integer). One solution would be to add an Integer variable and assign a number of 0 (‘F’) or 1 (‘T’). You could then run the case on the Integer. There are a few other ways like getting the index of an array of items, but they are a little more complicated.
-
Here’s a simple stored procedure we use to turn off vendor approval upon expiration. You can tailor to your needs. Can be run through Event Manager or Oracle Scheduler; your choice.
-
John Boyce
Member07/21/2021 at 8:56 AM in reply to: SQL STATEMENT TO KILL INACTIVE USERS AFTER SPECIFIC PERIODI’ve not seen Oracle error 1053, but you might try to log onto the service using the Administrator account rather than the local account. Stop the service, set the user and password and then re-start the service.
We are not using the CC barcode module, so not sure how that would be affected.
-
John Boyce
Member07/20/2021 at 7:54 AM in reply to: SQL STATEMENT TO KILL INACTIVE USERS AFTER SPECIFIC PERIODMahmoud,
Which program are you referencing? The OraKill program should work from any workstation and be visible, the service program does not have a user interface.
John
-
I’m not sure if there is a ready made view, but for us the payable to the royalty owner/consignor is created by posting the invoice that sells their product.
We’ve written our own program to handle the payments (due to more complex consignment formulas than used to be available in Quantum), but I think their consignment transactions work the same.
-
Mike is on the right path. Whenever you insert a sub-query or use the Into clause Oracle creates an implicit cursor that can contain 0 or 1 rows returned. If more than 1 is returned it doesn’t know which one to insert into your query and fails.
You either need to construct your sub-query where there can never be more than one row returned or break the query into several with an explicit cursor and loop through in a PLSql procedure.
-
I’m not sure, as we don’t manufacture. But I would think that as long as you add the manufactured part to stock and assign it to the consignment code before selling it, the process should work.
-
A royalty is similar to a consignment payment, so you could set up the inventory as a consignment with the royalty amount going to the supplier.
-
If you are talking about Oracle Triggers, which are connected to a specific Oracle table and fire upon either an insert, delete or update you would need to be VERY careful that they don’t interfere with the triggers already in Quantum.
If you are looking to run events in the Quantum database to execute procedures, etc. without the Event Manager you can do so using Oracle Jobs, Programs, Schedules and Procedures. We both use the Quantum Event Manager and run our own Jobs, often using the Schedules set up in Quantum by the Event Manager.
Both methods have their advantages and disadvantages, but they can work independently of each other. The Event Manager uses Oracle Jobs, Programs, Schedules and Procedures, but wraps them up in a single program and adds features for HTML, XML integration, etc. The result is emails that look professional and more.
In terms of naming conventions, we prefix everything we add to the database (tables, procedures, packages, etc.) with AASS. We have written a program that copies all the AASS metadata and table data from one schema to another and run it each time we upgrade or run Dataversion.
-
John Boyce
Member06/22/2020 at 8:40 AM in reply to: DISPLAY SQL ERROR MESSAGE INSTEAD OF BLANK REPORTMike,
Even without Event Manager, you can schedule jobs, execute PL/SQL procedures and send emails with the Oracle Scheduler. This is what Event Manager uses to process their scheduled events.
-
We installed 12.1.6 with the new imaging in a test environment yesterday. Will keep everyone in Que Group updated with our findings as we test both CC’s and our homegrown imaging systems. Thanks for the pointer on the encryption procedure John.
-
John Boyce
Member02/03/2020 at 8:29 AM in reply to: SQL STATEMENT TO CHANGE LOCATIONS BY MANUFACTURERI haven’t tested it, but I think a Procedure like below would work.
CREATE OR REPLACE PROCEDURE UPDATE_LOCATION
is
— This gets the stm_auto_keys for the records in the warehouse and location with the specified manufacturer
Cursor Csr is
Select stm.stm_auto_key
from STOCK stm join parts_master pnm on stm.pnm_auto_key = pnm.pnm_auto_KEY
join manufacturer mfg on pnm.mfg_auto_key = mfg.mfg_auto_key
join location loc on stm.loc_auto_key = loc.loc_auto_key
join warehouse whs on stm.whs_auto_key = whs.whs_auto_key
where whs.warehouse_code = ‘Your Warehouse’ and
loc.location_code = ‘Old Location’ and
mfg.mfg_code = ‘Manufacturer Code’;
loc_key integer;
Begin
For i in Csr Loop
— Now get the loc_auto_key for your new location
Select loc2.loc_auto_key
into loc_key
From location loc2
Where loc2.location_code = ‘New Location’;
— Assigne the new loc_auto_key to the selected record.
Update stock stm2
Set stm2.loc_auto_key = loc_key
where stm2.stm_auto_key = i.stm_auto_key;
End Loop;
End UPDATE_LOCATION;
-
We subscribe. It can be useful when you don’t have current information on a part, or are looking for additional sources. It integrates fairly seamlessly into Quantum and the upgrades are easy to apply.
They also have a stand alone product if you wish to integrate the data into a non-Quantum database. It’s a separate subscription and the data is delivered in FoxPro format as are the Quantum files.
-
Tony,
This code is to add a TMemo or TDBMemo to a screen form using the Screen Scriptor.
John
-
John Boyce
Member06/04/2019 at 11:57 AM in reply to: REMEMBER REPORT PARAMETERS FOR EACH USER (READ FROM A FILE?)There are several ways to do that if you call the Crystal Report from an executable. We use Delphi to create the executable to call the Crystal Report Viewer, but you can use any language that creates .exe files or uses .net assemblies.
With Delphi, it’s pretty easy to read parameters from the Registry or Ini files (they both have their advantages and disadvantages), and write back to the same entries.
Without writing a program, you can call the Crystal Report Viewer with a list of parameters from a Dos command file, but I don’t know how you would write those back to the Registry, etc. Probably a way, but I’m not very knowledgeable with Dos Shell programming.
-
Tony,
If the component on your form is a TMemo or TDBMemo, then you can have the property of WordWrap, which is enabled by default. TEdit and TDBEdit don’t have the WordWrap property.
Here’s an example of adding a TMemo to a form.
memoECCN := TMemo.Create(Form);
memoECCN.Parent := Form.tsMain;
memoECCN.Top := 80;
memoECCN.Left := 380;
memoECCN.Width := 75;
memoECCN.Height := 21;
memoECCN.Lines.Add(q.FieldByName(‘ECC_Number’).AsString);
memoECCN.ReadOnly := True;
memoECCN.WordWrap := True;
-
I agree with John that how you configure your memory for Oracle may be more important than the amount of physical memory available. This is a good article by Oracle on how to configure SGA/PGA. Every environment is different, and the defaults set by CC may not work for you.
https://docs.oracle.com/cd/E11882_01/server.112/e25494/memory.htm#ADMIN00207
-
Craig,
One other solution may be to use the scheduling capabilities of the Oracle database to schedule events without the Event Manager. If you understand the Oracle concepts of jobs, programs, schedules and stored procedures you can build your own.
Essentially, QC is using these metadata objects within the Event Manager.
We have the Event Manager module and find that both options work. In some cases (especially formatting pretty HTML emails), the Event Manager is superior, and in others we create our own.
If you are comfortable in writing your own stored procedures, the rest of the scheduling process is pretty straight forward.
John
-
We have had the same issue with stock reservations for years. Happens only occasionally with no particular pattern. Pretty sure it’s a bug in Quantum, but we have taken to just fixing the problems manually via SQL Manager when then occur. Most times it’s when someone tries to post an invoice and the quantities are out of balance.
I doubt that it’s a problem with Oracle and caches, as that would likely affect other transactions as well.
-
The structure of the Quantum Imaging is as follows:
As John correctly stated the keys for the images are stored in the Image_List table in the Quantum Oracle Schema.
On the Image Server there is a directory of the Image files (typically QuantumDocData). In the QuantumDocData directory is a sub-directory DATA. This contains all of the images in their native formats. The name of each file is the Image_Key (from the Image_List table) and the suffix .qid.
Additionally in the DATA directory is a subdirectory INDEXES containing are two additional subdirectories, KEY and NAME.
The NAME directory contains a text file for each file name contained in the Image System. In the text file are the Image_Keys of any file that contains file name. This allows more than one file with the same name in the image system.
The KEY directory contains a text file for each .QID image in the DATA directory with the name of the Image_Key + .idx. In this file is the name of the Image with the relevant Image_Key (and therefore a link to the appropriate NAME file) and a listing of which program will open the connected QID file. This is how Quantum knows to open the linked file with PDF Reader, Excel, etc.
Finally, there is a binary file named HIGHKEY.DAT in the QuantumDocData directory that is used to increment the Image_Key when adding new images. This file is not used when reading images, but is necessary to add any new images.
If a program like Docuware didn’t know how to modify all of these files in the same way that Quantum does, it would not work.
There can also be more than one Image Server attached to Quantum, which makes it a little more complicated.
Hope this helps.
-
Here’s an example in forms designer:
Text := formatdatetime(‘dd-mmm-yy’, SO_DETAIL[‘SHIP_DATE’]);
-
Unless Docuware has written a specific interface for Quantum, I would doubt that it can just scan into the stock line or order. Quantum’s imaging system uses multiple files and indexes to link everything together, as the images are not in the Oracle database, or necessarily on the same server.
If you are talking about a separate Document repository outside of Quantum that would be different.
I would get a live demo where images are moved from the mobile device directly into Quantum imaging before pulling the trigger.
-
If you have problems with disconnected sessions taking a license, I’ve donated a couple of programs to the Que Group that may help. The first is a service that runs on the Quantum Server and automatically terminates sessions after a pre-determined period of inactivity.
The second is a Windows program with a user interface that allows you to see all connections to MaxQProd (including Quantum and other connections as all take a license), and to manually terminate by clicking a check box next to the connection.
They should be on the Que Group file upload site.
-
Mike is correct that you can get the next auto key manually, but keep in mind that the trigger TI_CQ_HEADER gets and inserts the next auto key automatically on any CQ_Header Insert.
-
Further to Mike’s comments, in a round about way, you could link from the invoice header to the company record and then to all of the rolodex entries for that company (via the company_rolodex table to link the company table to the rolodex table), and then via the email address in the rolodex to the email address in the invoice header. The only flaws would be if there were more than on rolodex email address in a particular company to match to the invoice header, or if someone put in an email address in the invoice header that was not in the rolodex.
Also a fair bit of work to link one complex or several queries.
-
P.S. The Report Builders manuals can be found here:
-
Henrik,
Try something like this:
var
fullNumber : integer;
decimal : double;
number: double;
begin
Label15.Text := ‘12.236146’;
number := StrToFloat(Label15.Text);
fullNumber := Trunc(Number);
decimal := number – fullnumber;
Label15.Text := intToStr(fullNumber) + ‘:’ + FloatToStr(Trunc(RoundToNDecimals((decimal * 100),0)));
end;
I got 12:24 as an answer.
John
-
John Boyce
Member05/11/2018 at 8:52 AM in reply to: ADD FIELD WITH A HYPERINK LIKE RO HEADER SHIPMENT TRACKINGAndrej,
I don’t think this is possible with the current screen scriptor. To make a label into a hyperlink requires the Delphi shellapi unit, which is currently not available in Screen Scriptor. Also, if it were available the click event to the hyperlink would only be available on FormShow or BtnOKClick. So you’d have to do something like add a check box next to the hyperlink and if the checkbox was selected at the time of clicking the OK Button, then go to the hyperlink.
John
-
John Boyce
Member04/14/2018 at 2:03 PM in reply to: ADD FIELD WITH A HYPERINK LIKE RO HEADER SHIPMENT TRACKINGMike,
If the control is database enabled, it will reflect what the user clicked at the time that the user then clicks the OK button. You can try it out on a DB enabled field, but it showed the changed value for me on the priority radio group of the SO edit screen.
John
-
John Boyce
Member04/13/2018 at 9:17 AM in reply to: ADD FIELD WITH A HYPERINK LIKE RO HEADER SHIPMENT TRACKINGOne thing I noticed when looking at this is that the classes used on the forms for Radio Groups are TccRadioGroup and TccDBRadioGroup. What this seems like is that CC took the standard Delphi components and modified them to their own version through inheritance. They, then, may or may not have the same properties, methods, etc. as their parent class.
That said, if the component is a TccDBRadioGroup you can get the result from the underlying database field. For example in the SO item form I was able to get the value for the priority as follows:
(Doesn’t Work)
ShowMessage(‘Radio Selection ‘ + IntToStr(Form.rgPriority.ItemIndex));
(Works)
ShowMessage(‘Radio Selection ‘ + IntToStr(Form.Dataset.FieldByName(‘Priority’).AsInteger));
Hope this helps.
-
John Boyce
Member04/12/2018 at 10:02 AM in reply to: ADD FIELD WITH A HYPERINK LIKE RO HEADER SHIPMENT TRACKINGI think you’re going to be stymied by the fact the Screen Scriptor only has events available for the FormShow and BtnOKClick. You would need an event available for the TLabel or TEdit object which could pass the value of the label or edit object to a function to process the link.
Here’s a link to a YouTube video on how to do it in Delphi if you have the full development environment: https://www.youtube.com/watch?v=PSPhiG_rPV4
-
Stored Procedures and Functions are not deleted in an upgrade, but Packages, Tables, Views, etc. are.
By the way, you can also execute stored procedures, queries, etc. from any Windows executable. More programming required, but you have better control over security, user options, etc. We use Delphi for Quantum programming (the same language that the core Quantum is written in), but options such as Microsoft VB would work as well.
-
James,
You wouldn’t need a separate database. You could put the log table in a separate schema in the same database and grant access to the new schema to QCTL (or whatever schema you are connecting to). In that instance the only thing that would have to be done after running Dataversion would be to re-create the triggers.
John
-
One way would be to expand upon what James identified with the sys_user_db_session table. As the system appears to write an entry into the table upon login and delete the entry upon logout, you could create your own table of login/logout entries, and create two triggers for the sys_user_db_session table, one triggered with an insert, and one with a delete. In each case you would write an entry into your table with the timestamp. A little cumbersome, but doable. Keep in mind that your tables/triggers would be eliminated when running DataVersion, so you would have to account for that.
-
CC may have a Linux version of the component. They use Linux for their Portal VM, and have a similar way of connecting.
-
Component Control’s password algorithm for Quantum Passwords is proprietary. However, they do have a .net DLL that will return a true if you pass it the correct password, and a false if you don’t. We’ve developed a Delphi component to call the .net DLL that we use to access Quantum with password for all of our internally developed programs.
I believe that they would give you the DLL if you ask.
-
We are on 10.8.22. Also, we have created our own Imaging ecosystem to allow for adding images outside of Quantum, with a program that can be run locally, that identifies the record to attach the image to and then stores that information locally. Separate service programs repeatedly scan for images to be loaded and move them across the Internet, etc. and into Quantum. This allows for some features that aren’t easily done in Quantum, like loading thousands of images quickly and leads to no upload delays within Quantum. Images typically show up in Quantum within about 1 minute. We also use the standard Quantum imaging system depending on the situation. Our homegrown software uses the TWAIN interface, which is why we have moved to Epson scanners. Future plans call for expanding our system to mobile devices, but that hasn’t been done yet.