[Solved] PL/SQL Triggers -firing question3
Try this…. for trigger CREATE TRIGGER insert_book ON [dbo].[Books] FOR INSERT AS insert into books (id_book,title) values(12,’book12′); PRINT ‘Insert Book’ GO 6 solved PL/SQL Triggers -firing question3
Try this…. for trigger CREATE TRIGGER insert_book ON [dbo].[Books] FOR INSERT AS insert into books (id_book,title) values(12,’book12′); PRINT ‘Insert Book’ GO 6 solved PL/SQL Triggers -firing question3
EXIT WHEN FLAG=1/*give some exit criteria here .You wrote update statement which was incorrect*/; –update table set counter=1 where counter is NULL; — LOOP until condition is met END LOOP; 0 solved ORA-06550: line 13, column 4: PLS-00103: Encountered the “UPDATE” ORA-06550: line 15, column 3: PLS-00103: Encountered the symbol “END”
If “mirror” is reversed text use: SELECT REVERSE(‘my_text’) FROM dual; EDIT: SqlFiddleDemo SELECT t ,REVERSE(t) AS Mirror1 ,TRANSLATE(t, ‘abcdefghijklmnopqrstuvwxyz’,N’ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz’) AS Mirror2 ,TRANSLATE(REVERSE(t), ‘abcdefghijklmnopqrstuvwxyz’,N’ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz’) AS Mirror3 FROM tab; 2 solved Sql code to create the Mirror image of the string in Oracle sql [closed]
In simple terms, trim removes whitespace from the beginning or end of a bit of text. For instance, it will turn ‘myvalue ‘ into ‘myvalue’ and ‘ tonsofexteriorwhitespace ‘ into ‘tonsofexteriorwhitespace’. Note that it won’t remove whitespace from the interior of the text though, so ‘ interior spaces remain ‘ becomes ‘interior spaces remain’. It … Read more
It is very clear that you are not creating a dynamic query properly. Space is missing between TABLE’|| C.table_name It must be something like this: EXECUTE IMMEDIATE ‘TRUNCATE TABLE ‘|| C.table_name; — see space after TABLE Cheers!! 3 solved ANYONE CAN TELL ME THAT WHY THIS CODE IS GIVING ME AN ERROR OF TABLE OT … Read more
You can use exceptions. Try this: DECLARE y NUMBER; b emp.ename%TYPE; BEGIN y := :enter_no; SELECT ename INTO b FROM emp WHERE empno = y; EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE(b); END; 0 solved VALUE NOT EXIST (SQL)
select all_people from call_centerDB where called_nos=92222 OR called_nos=122323 OR called_nos=9988898 solved Please help me out for the following scenario [closed]
CREATE OR REPLACE PROCEDURE log(repname in varchar2) AS PACKAGE_NAME VARCHAR2,– give size here like varchar2(50) START_TIME DATE, END_TIME DATE, STATUS; BEGIN SELECT PACKAGE_NAME , PRCS_START_TIME , PRCS_END_TIME, STATUS — add into clause to assign selected –values in variables FROM CONTCL_OWNER.PROCESSLOG WHERE PACKAGE_NAME LIKE ‘%REPNAME%’ And ROW_NUMBER <=7 ORDER BY PRCS_START_TIME ; END; solved My PL/SQL … Read more
If by private, you mean a procedure that’s defined in the package body and not exposed in header, then no. The other package won’t be able to “see” the procedure. SQL> CREATE OR REPLACE PACKAGE foo AS END; — No “public” procedures/functions 2 / Package FOO compiled SQL> CREATE OR REPLACE PACKAGE BODY foo 2 … Read more
The INTO goes just after the SELECT part, before the FROM. select e.editionid into tagnow from webtags w, edition e Also, try to learn standard ANSI JOIN, instead of using this old Oracle way, and pay attention in using aliases in joiur join conditions. You query would become: SELECT e.editionid INTO tagnow FROM webtags w … Read more
the program is not accepting today’s date. it gives me error (the program should only accept today’s date and date in the future ) solved the program is not accepting today’s date. it gives me error (the program should only accept today’s date and date in the future )
Since your procedure has an out variable, provide it with a fifth variable to get the out value: declare p_user_id int; begin insert_user(‘user’, ‘password’, ‘[email protected]’, ‘5’, p_user_id); end; Note: You don’t set the value in your procedure, so you could either let it away at all or you have to set it in your procedure. … Read more
You are missing IN in the FOR statement; it should be: FOR rec IN (SELECT privilege, admin_option FROM dba_sys_privs WHERE grantee = l_username) LOOP See http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/static.htm#CIHCGJAD 2 solved SQL Procedure Removing System Privledges [closed]
I presume you mean ansi SQl. In general, the answer would be specific to the way the two queries were written. You can write a bad query in either language to produce the same result. However, most of the time, the database vendors code written specifically for that engine will outperform generic SQl for complex … Read more
“Now I am getting 9 rows” The outer loop steps through an array of three elements. The nested loop steps through an array of three elements for every element in the outer loop. 3 * 3 = 9. “how to get ‘AA’ ‘BB’ ‘CC’ from below query” Apply Occam’s razor and discard the inner loop: … Read more