Here is the reporter output:
Mitchs-MacBook-Pro:tshirtShop Bugzy$ mocha --exit test/models/product-db.js
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules/sequelize/lib/sequelize.js:242:13
Product to DB
Executing (default): INSERT INTO `product` (`product_id`,`name`,`description`,`price`,`discounted_price`,`image`,`image_2`,`thumbnail`,`display`) VALUES (DEFAULT,'BLah BLah','\"The Fur Merchants\". Not all the beautiful stained glass in the great cathedrals depicts saints and angels! Lay aside your furs for the summer and wear this beautiful T-shirt!','22.95','17.95','chartres-cathedral.gif','chartres-cathedral-2.gif','chartres-cathedral-thumbnail.gif',1);
ALl properties created corretly
✓ can create a new Product and save it to the db (832ms)
Executing (default): SELECT `product_id`, `name`, `description`, `price`, `discounted_price`, `image`, `image_2`, `thumbnail`, `display` FROM `product` AS `Product` WHERE `Product`.`product_id` = 1;
✓ can find the first record (77ms)
Not-nullable properties give the proper validation errors
✓ Error thrown for name
✓ Error thrown for description
✓ Error thrown for price
✓ Error thrown for discounted_price
✓ Error thrown for display
7 passing (932ms)
I want to get rid of the Executing (default) statements. I have gone through all the reporter options but the SQL statements remain.
Related
I am trying to create function in oracle 12c database using liquibase, below is the sql formatted changelog. I am doing negative testing to see what response i get, purposefully using wrong keyword returns
--liquibase formatted sql
--changeset your.name:1 failOnError:true
CREATE OR REPLACE FUNCTION get_tab1_count RETURNS NUMBER AS
l_count NUMBER;
BEGIN
SELECT COUNT(*)
INTO l_count
FROM person3;
RETURN l_count;
END;
/
This change log gets updated successfully, but as expected in the database I have a function now which has compilation errors,
Compilation errors for FUNCTION GET_TAB1_COUNT
Error: PLS-00103: Encountered the symbol "RETURNS" when expecting one of the following:
( return compress compiled wrapped
my question is am i doing something wrong, that liquibase is giving a "update has been successful" message? Or is this expected behaviour? I have tried adding failOnError:true in the changelog to see if it will actually now fail as there is a compilation error during function creation, but it does not make any difference. I would think that, liquibase would give some sort of failure message when there is a compilation error like the above, am I wrong?
Liquibase is just running your changeset as sql being passed to a JDBC connection.
quoting a colleague: "the jdbc connection gives us for a response and I THINK most databases are just "yes, you created that fine" even though it is not actually valid at this point. But, they don't tell us until we run it"
As a work around you could write a script that checks for compilation errors and fails when it finds any issues. Create an execute change set with runAlways="true"
I want to create a trigger but it is tainted by a warning: trigger created with compilation errors. The query that I am running is:
CREATE OR REPLACE TRIGGER Audit_Salaries
AFTER UPDATE ON EMPLOYEES
FOR EACH ROW
BEGIN
IF (:NEW.Salary > :OLD.Salary*1.20) THEN
INSERT INTO Salary_Audit (EmployeeID, OldSalary, NewSalary,Username, ChangeDate)
VALUES (:NEW.employee_id, :OLD.Salary,:NEW.Salary, user, sysdate);
END IF;
END;
/
Warning: Trigger created with compilation errors.
And this is the result that I am getting:
Warning: Trigger created with compilation errors.
I tried reading other similar answers but the solutions that are given there already exist in mine(syntax).
Due to this, when I log into the different user and run the query, it says the trigger is at fault or not created properly, re-validation failed.
I expect the trigger to be created without any compilation errors along with the understanding of what is wrong in my query.
To see the details of the compilation error, you can query system view USER_ERRORS (or DBA_ERRORS):
SELECT * FROM USER_ERRORS WHERE NAME = 'AUDIT_SALARIES';
I cannot reproduce the error that you are getting, your code compiles successfully when I run it on 11gR2 and 18c. I can only imagine that there is an error in the column names of source table employees or target table salary_audit.
Demo on DB Fiddle
You can see the compilation error using DBA_ERRORS.
SELECT * FROM DBA_ERRORS WHERE NAME = 'AUDIT_SALARIES';
You tagged SQL Developer.
Are you using SQL Developer?
Because if you are...
We automatically do a 'show errors' for you on a compile when errors/warnings are returned. You can also see the compiler messages on the 'Compiler' tab - this should open automatically when you run it.
If you're not seeing this, I'm guessing you're on some version of SQL Developer where a bug is preventing that from happening, but I'm not aware of a version where that would be true.
Try this it will solve you query:
SELECT * FROM DBA_ERRORS WHERE NAME = 'AUDIT_SALARIES'
OR
SELECT * FROM USER_ERRORS WHERE NAME = 'AUDIT_SALARIES';
I have IG in Apex
SELECT invoice_id,
line_number,
line_type_lookup_code,
item_description,
quantity_invoiced,
unit_price,
amount
FROM my_table
WHERE invoice_id = :P19_INVOICE_ID
when the query returns data, inserting a record works fine, but if the query does not return data and I try to insert it, it returns the error Ajax call returned server error ORA-01403: no data found for.
You're fighting an unknown & invisible enemy.
Run the page in debug mode; once it raises the error, review debug info. Scroll down to the error and check what's going on - you should see a query which failed. Then you'll be able to fix it (hopefully).
I would like to ask is it possible to catch syntax errors on exception block ? Example I've below exception in my code, when it hit exception it would notify me via email. I know syntax errors is during compilation, so it won't execute exception block, but is it possible to catch it ?
EXCEPTION
WHEN OTHERS
THEN
SEND EMAIL
The procedure wont be compiled if there are syntax error.
in order to catch exception the Procedure should be compiled, if there are errors then you have to fix them.
However you can create a procedure that run your procedure(as a string, dynamically), if your second procedure contain error , even syntax error , you can catch it and insert it into table.
Check this link for more info
other way you can also write a program which can check invalid objects and send mail to you with object names.
here is sql to check invalid objects.
select * from all_objects where object_type in
('PACKAGE','PACKAGE BODY', 'PROCEDURE','FUNCTION') and status ='INVALID'
for syntax error you need to use tool like toad, pl/sql developer, sql developer etc. to show errors.
This code generates a Warning: Trigger created with compilation errors. (if for example the column doesn't exist) in iSQL*Plus, but not when executed in the console in Intellij.
CREATE TRIGGER triggerName
INSTEAD OF INSERT ON Table
REFERENCING NEW AS variabel
BEGIN
SELECT
COUNT(*)
INTO variabel
FROM Table
WHERE Table.column = 1;
END;
After I have executed the above I can do SHOW ERRORS in iSQL*Plus and get something like PL/SQL: ORA-00904: "TABLE"."COLUMN": invalid identifier. Trying to do SHOW ERRORS in Intellij leaves me with the SHOW keyword underlined in red which prevents me from executing it.
Is there anyway to have this iSQL*Plus functionality in Intellij?
Using ALL_ERRORS/USER_ERRORS table should help you see the errors, wherever you go!
SELECT * FROM ALL_ERRORS WHERE NAME = 'TRIGGERNAME'
SHOW ERRORS is an iSQL*Plus only feature. It would implicitly query the above table and print the results for us.
I see some plugins available for intellij support. Like one here. They would be using similar approach of SHOW ERRORS.