I'm trying to export an oracle apex app
variable AppId number
begin
select application_id into :AppId FROM apex_applications where alias = 'SOMEALIAS';
end;
/
print AppId
apex export -applicationid AppId;
This script shows a valid app id in the line print AppId however the export statement returns the following error :
Invalid Workspace ID null
If I do manually :
apex export -applicationid 1116;
It works.
Does anyone know how to solve that please ?
Thanks
Related
using Oracle DB 10 and SQuirrel 3.7.1
I need to access inserted-fields
If I write in an Oracle trigger script - :new.fieldName,
when running the script - I get an input window that says:
"Please input the parameter values
Value for ' :new' ___________ "
the trigger is compiled with a warning - "EDT violation detected"
when the trigger is executed (using an insert) , there's an error:
" Error: ORA-04098: trigger 'schemeName.triggerName' is invalid and failed re-validation
SQLState: 42000
ErrorCode: 4098
Position: 2172 "
what am I missing ?
trigger script:
CREATE OR REPLACE TRIGGER schemeName.triggerName
AFTER INSERT ON schemeName.tableName1
FOR EACH ROW
BEGIN
Insert into schemeName.tableName2 (fieldName1, fieldName2) values (:new.fieldName, 'someString');
END;
/
Your tool (SQuirrel 3.7.1) understands : as if you wanted to enter a substitution variable.
There should be an option which turn that OFF (at least temporarily) so that you could create a trigger.
goto plugins -> summary, disable sqlparam-plugin and restart squirrel.
I'm trying to get the Hostname, Terminal of logged user in Oracle APEX.
Normally when using database is easy.
e.g.
SELECT SYS_CONTEXT('USERENV','TERMINAL') FROM DUAL;
I have APEX running through tomcat 9.0 on linux server.
When I try it on APEX I get "unknown" value. When I try to get hostname
SELECT SYS_CONTEXT('USERENV','host') FROM DUAL;
I get the name of server that apex/ords/tomcat is running. I need to get the name of terminal of logged user.
Have you tried:
begin
if( owa_util.get_cgi_env('X-Forwarded-For') is not null) then
htp.p('Client address is: ' || owa_util.get_cgi_env('X-Forwarded-For'));
else
htp.p('Remote address is: ' || owa_util.get_cgi_env('REMOTE_ADDR'));
end if;
end;
from
https://community.oracle.com/thread/3994246?start=0&tstart=0
I had built a few tables with sequences and triggers, since I need to share the script with my team at uni I did an export with sqldeveloper, now when I try to import/execute the resulted .sql I'm getting errors with triggers.
This is the error message:
"Error starting at line 250 in command:
CREATE OR REPLACE EDITIONABLE TRIGGER "TRG_ACCOUNTS"
BEFORE INSERT ON ACCOUNTS
FOR EACH ROW
BEGIN
SELECT SEQ_ACCOUNTS.NEXTVAL INTO :NEW.ACCOUNT_ID FROM DUAL
Error report:
SQL Command: editionable TRIGGER
Failed: Warning: execution completed with warning
Error starting at line 258 in command:
END
Error report:
Unknown Command
trigger "TRG_ACCOUNTS" altered."
This is the part of the script it's complaining about. I have a few other triggers and it's giving me the same error on all of them. I've checked how the triggers are created after executing the script, and all of them seem to be missing a semi colon and the "END;" at the end.
Example:
create or replace
TRIGGER "TRG_FL_AR"
BEFORE INSERT ON FLOOR_AREAS
FOR EACH ROW
BEGIN
SELECT SEQ_FL_AR.NEXTVAL INTO :NEW.FLOOR_AREA_ID FROM DUAL <-- missing ";" here
<missing "END;" here>
Could you please help me?
Thank you.
Try to put a back slash / after line 258 and check again
Problem
I just want to see the value of a variable. I don't understand why this has to be so difficult.
My SQL Statement
--set serveroutput on format wrapped; Tried this too
SET SERVEROUTPUT ON;
--DBMS_OUTPUT.ENABLE(32000); Tried with, and without this
vend_num xx.VENDOR_CWT.VEND_NO%TYPE;
SELECT vend_no
INTO vend_num
FROM xx.VENDOR_NAME
WHERE VENDOR_NAME1 = 'xxxx';
dbms_output.put_line(vend_num);
The Error I'm Geting
Error starting at line 13 in command:
dbms_output.put_line(vend_num)
Error report:
Unknown Command
What I've Tried
I've tried the following answers:
Print text in Oracle SQL Developer SQL Worksheet window
Printing the value of a variable in SQL Developer
I've done what this answer suggested with the gui: https://stackoverflow.com/a/7889380/496680
I've tried exec dbms_output[...] as some posts have suggested.
Question
How do I just print the value of vend_num;
DBMS_Output is a PL/SQL package, so you'd call it from within PL/SQL code.
declare
end_num xx.VENDOR_CWT.VEND_NO%TYPE;
begin
SELECT vend_no
INTO vend_num
FROM xx.VENDOR_NAME
WHERE VENDOR_NAME1 = 'xxxx';
dbms_output.put_line(vend_num);
end;
/
Got problem with executing my script under SQLPLUS. Under SQL Developer it works well.
set serveroutput on size 1000000
declare
yyy varchar2(32000):='';
begin
yyy := 'XxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzz';
yyy := yyy || 'XxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzz';
yyy := yyy || 'XxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzzXxxYyyZzz';
dbms_output.put_line(yyy);
end;
/
Under SQLPLUS I get error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 1
Any solution how to force running scripts with long output under SQLPLUS? I need output on because I spool results to file.
You are using a Oracle client older than Oracle 10g against an Oracle 10g Database
Please find the quote from ASKTOM below
The problem is NOT during runtime, you are apparently using an old client against a 10.2 or above database. The database code runs fine
It is when the client goes to PICK UP THE STRING from the database that you are hitting the exception.
sqlplus is doing something like this:
a) call procedure/code - it runs and fills a dbms_output buffer, an array in a package.
b) then sqlplus calls dbms_output.GET_LINES to get the buffered output to print. THIS is the call that fails.
For more information Kindly refer
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011431134399