Describe the Table inside the PLSQL procedure
Dear all,I write a procedure which takes tablename as input and displays these columns in the table as output. How to describe a table within a plsql procedure. Also how to display columns, because each table will have a different number of columns. Please suggest.
Thank you and best regards,
Mahesh
Hello
You can have a procedure like this
CREATE OR REPLACE PROCEDURE retrieve_tab_cols_prc(l_table_name VARCHAR2,l_owner_name varchar2) AS
CURSOR TAB_COL_CURSOR IS
select *
from all_tab_cols
where table_name = l_table_name
and owner = l_owner_name
ORDER BY column_id;
BEGIN
FOR CUR_REC IN TAB_COL_CURSOR
LOOP
dbms_output.put_line(CUR_REC.COLUMN_ID||' : '||CUR_REC.COLUMN_NAME);
END LOOP;
END retrieve_tab_cols_prc;
Procedure created.
SQL> begin
2 RETRIEVE_TAB_COLS_PRC('EMP','SCOTT');
3 end;
4 /
1 : EMPNO
2 : ENAME
3 : JOB
4 : MGR
5 : HIREDATE
6 : SAL
7 : COMM
8 : DEPTNO
Tags: Database
Similar Questions
-
Business event does not trigger the PLSQL procedure... What should do?
We need to call a plsql procedure when the workflow approval GL ended with approval. I thought I could do it by customizing the relevant business event.
We are on EBS 12.1.3 with RDBMS: 11.2.0.3.0.
I see the event oracle.apps.gl.Journals.journal.approve company has been disabled currently. I've enabled and created a subscription for her. Subscription was a PLSQL procedure. Currently, for objective test only thing it does is to insert a row in a table.
Parameters of the subscription to corporate events:
System: ORDEBS. SYSTEM.COM
Triggering event
Source type: Local
Event filter: oracle.apps.gl.Journals.journal.approve
Execution condition
Phase: 100
Status: enabled
Rule data: Message
Action type: custom
Error on: stop blocking and cancellation
Action
Rule of PL/SQL function: XX_GL_APPROVE_BE_PKG. Get_Attributes
Priority: normal
Documentation (not sure what value to give the latter. I went with the values below).
Owner: Name of the company
Tag owner: custom Schema
Using query I can see the event company is called when occurs below approval (an added line each time approval that has happened). But I don't see all the lines in the table where to insert a line. What could go wrong? How can I make sure that the procedure was called?
Select * from WF_DEFERRED where corrid'art = 'APPS:oracle.apps.gl.Journals.journal.approve. '
Procedure:
CREATE OR REPLACE PACKAGE BODY APPS. XX_GL_APPROVE_BE_PKG
AS
PROCEDURE Get_Attributes
IS
BEGIN
INSERT INTO xx.xx_test_table VALUES (' to BE');
COMMIT;
END Get_Attributes;
END XX_GL_APPROVE_BE_PKG;Hello
This OWNER_TAG represents an actual application under license, as "DNF" without the quotes. The business event system will send subscriptions for licensed products.
Also, in order to detect any other possible errors please add a subscription of type error. In this way the BES will catch the error and will notify SYSADMIN of this failure, it's not silent. You can use this link to see how: https://blogs.oracle.com/oracleworkflow/entry/defining_business_events_with_synchronous
Kind regards
Alejandro
-
Retrieve the name of tables and its plsql procedure schema
Hello
Help me please pass my last training evaluation
the task is:
between the username and the password and then who will retrieve tables exist and the script for each table.
the output should be like:
user name: -.
table_name1:
table_name1 script
table_name1 script
table_name1 script
table_name2:
table_name2 script
table_name2 script
table_name2 script
.
.
.
and so on
in the last of the production
You should see the following:No tables for: username: table_numbers
Please help me.
If your boss wants to test your ability to write code and understand the dictionary of data, then you can try something like this:
begin for t in ( select table_name from user_tables order by table_name ) loop dbms_output.put_line(t.table_name); for c in ( select * from user_tab_columns c where c.table_name = t.table_name order by c.column_id ) loop dbms_output.put_line(' ' || rpad(c.column_name,31) || c.data_type); end loop; dbms_output.new_line(); end loop; end;
This just lists the tables and their columns. You must understand how to add more details and to make a set of
create table
statements.If it ask for user name and password there must probably be a SQL * more script (.sql file). He could use ACCEPT to invite (there are examples at the bottom of the page).
-
Cannot create the plsql procedure, fails at the cursor
He was a working procedure that would take ID and then copy the data from the source to the destination parameter parameter. Now I would like to have the NAME as a parameter, I changed the code to accommodate the new settings. But I'm not able to create the procedure. I get error 3-CURSOR (in bold red). I would really appreciate if someone can take a look and let me know what the problem is.
Thanks in advance
3 errors
1 PLS-00103: encountered the symbol "CUR_V_HSP_COLUMN_DETAIL" during the expected in the following way:
:= . ( @ % ;
The symbol ': = ' was replaced by 'CUR_V_HSP_COLUMN_DETAIL' continue.
2 PLS-00103: encountered the symbol "NUMBER" when expecting one of the following conditions:
(
The symbol "(" was substituted for "NUMBER" to continue.
3 PLS-00103: encountered the symbol "NUMBER" when expecting one of the following conditions:
(
CREATE or REPLACE procedure EPM_PLAN_PLANSAMP. Copy_Details_test1 - Arguments
( IN VARCHAR2, HSP_object in_From_Version_Name.) Object_name - Version of
in_From_Scenario_Name IN VARCHAR2, HSP_object. Object_name - scenarios of
in_From_Year_Name IN VARCHAR2, HSP_object. Object_name - year from
in_To_Version_Name IN VARCHAR2, HSP_object. Object_name - Version to
in_To_Scenario_name IN VARCHAR2, HSP_object. Object_name - scenarios
in_To_Year_Name IN VARCHAR2 - HSP_object. Object_name - year to
)
IS
number of v_From_Object_Id; -Version of
number of s_From_Object_Id; -Scenarios of
number of y_From_Object_Id; -The year of
number of v_To_Object_Id; -Version to
number of s_To_Object_Id; -Scenarios to
number of y_To_Object_Id; -The year to
BEGIN
Select object_id in v_From_Object_Id
of hsp_object
where type_objet = 35
and object_name = in_from_version_name;
Select object_id in s_From_Object_Id
of hsp_object
where type_objet = 31
and object_name = in_from_scenario_name;
Select object_id in y_From_Object_Id
of hsp_object
where type_objet = 38
and object_name = in_from_year_name;
Select object_id in v_To_Object_Id
of hsp_object
where type_objet = 35
and object_name = in_to_version_name;
Select object_id in s_To_Object_Id
of hsp_object
where type_objet = 31
and object_name = in_to_scenario_name;
Select object_id in y_To_Object_Id
of hsp_object
where type_objet = 38
and object_name = in_to_year_name;
-Select Details of support for the current Version
CURSOR Cur_V_HSP_COLUMN_DETAIL (cV_From_Object_Id in NUMBER, cS_From_Object_Id number) IS
Select DETAIL_ID in the EPM_PLAN_PLANSAMP. HSP_COLUMN_DETAIL where DIM5 = cV_From_Object_Id AND DIM1 = cS_From_Object_Id;
li_DETAIL_ID NUMBER;
Li_Next_DETAIL_ID NUMBER;
FETCH_STATUS NUMBER: = 0;
v_step_name varchar2 (200);
v_rec_cnt number: = 0;
number of v_cnt;
v_err varchar2 (2000);
-----------------------------------------Begin Copy Version ---------------------------
BEGIN
-Removed next version if already exists
v_step_name: = 'delete the HSP_COLUMN_DETAIL_ITEM ";
Remove from HSP_COLUMN_DETAIL_ITEM
Where DETAIL_ID in (Select DETAIL_ID from HSP_COLUMN_DETAIL
Where = v_To_Object_Id AND DIM1-DIM5 = s_To_Object_Id);
v_cnt: = number of lines sql %;
insert into t_copy_supporting_dtls_log values (v_step_name, v_cnt, 1, sysdate, 'success');
v_step_name: = 'delete the HSP_COLUMN_DETAIL ";
Remove from HSP_COLUMN_DETAIL
where = v_To_Object_Id AND DIM1-DIM5 = s_To_Object_Id;
v_cnt: = number of lines sql %;
insert into t_copy_supporting_dtls_log values (v_step_name, v_cnt, 1, sysdate, 'success');
Open Cur_V_HSP_COLUMN_DETAIL (v_From_Object_Id, s_From_Object_Id);
v_step_name: = "Insert";
LOOP
Look FOR Cur_V_HSP_COLUMN_DETAIL IN li_DETAIL_ID;
WHEN the OUTPUT Cur_V_HSP_COLUMN_DETAIL % NOTFOUND;
-Find the next detail_id
Select Max (DETAIL_ID) + 1 IN HSP_COLUMN_DETAIL Li_Next_DETAIL_ID;
-Insert in the Table HSP_COLUMN_DETAIL
Insert into HSP_COLUMN_DETAIL (DETAIL_ID, PLAN_TYPE, DIM1, DIM2, DIM3, DIM4, DIM5, 6,
DIM7, DIM8, DIM9, DIM10, DIM11, DIM12, DIM13, DIM14, DIM15,
DIM16, DIM17, DIM18, DIM19, DIM20)
Select Li_Next_DETAIL_ID, PLAN_TYPE, S_To_Object_Id, DIM2, DIM3, DIM4, V_To_Object_Id, 6.
DIM7, DIM8, DIM9, DIM10, DIM11, DIM12, DIM13, DIM14, DIM15,
DIM16, DIM18, DIM19, DIM17, DIM20
Of HSP_COLUMN_DETAIL
Where DETAIL_ID = li_DETAIL_ID;
v_rec_cnt: = v_rec_cnt + sql rowcount %;
-Insert in the Table HSP_COLUMN_DETAIL_ITEM
Insert into HSP_COLUMN_DETAIL_ITEM (DETAIL_ID, VALUE, POSITION, GENERATION, OPERATOR, LABEL)
Select VALUE, POSITION, GENERATION, OPERATOR, Li_Next_DETAIL_ID, LABEL
From HSP_COLUMN_DETAIL_ITEM where DETAIL_ID = li_DETAIL_ID;
v_rec_cnt: = v_rec_cnt + sql rowcount %;
END LOOP;
Close Cur_V_HSP_COLUMN_DETAIL;
insert into t_copy_supporting_dtls_log values (v_step_name, v_rec_cnt, 1, sysdate, 'success');
commit;
exception when others then
Rollback;
v_err: = substr (sqlerrm, 1, 2000);
insert into t_copy_supporting_dtls_log values (v_step_name, 0, -1, v_err, sysdate);
commit;
END;
END;
/
You DECLARE the cursor before using it.
-
PLSQL procedure with the ORA-01858: a non-digit character was found where
Hi friends,
I'm pretty much back to the plsql programming. I am creating the plsql procedure that basically accepts the values of variables and controls difference of two columns if she's even if different it inserts values into the temporary table GTT_S_DOC_QUOTE, and then inserts data into another table in s_doc_quote please help me or correct my procedure.
Since I'm getting below error ORA-01858: a non-digit character was found here where waiting a digital .my procedure is as below.
CREATE OR REPLACE PROCEDURE QUOTE_STS)
ROW_ID_IN GGATE_CT. GTT_S_DOC_QUOTE. ROW_ID % TYPE,
STAT_CD_IN GGATE_CT. GTT_S_DOC_QUOTE. STAT_CD % TYPE,
PREV_STS_CD_IN GGATE_CT. GTT_S_DOC_QUOTE. PREV_STS_CD % TYPE,
BU_ID_IN GGATE_CT. GTT_S_DOC_QUOTE. BU_ID % TYPE,
CREATED_IN GGATE_CT. GTT_S_DOC_QUOTE. CREATED % TYPE,
X_CRRNT_TOT_AGRD_RMS_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_TOT_AGRD_RMS % TYPE,
X_CRRNT_TOT_BLCKD_RMS_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_TOT_BLCKD_RMS % TYPE,
X_CRRNT_TOT_PCKDUP_RMS_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_TOT_PCKDUP_RMS % TYPE,
X_CRRNT_TOT_PCKDUP_AVGRT_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_TOT_PCKDUP_AVGRT % TYPE,
X_CRRNT_TOT_BLCKD_AVGRT_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_TOT_BLCKD_AVGRT % TYPE,
X_CRRNT_CNTRCT_SR_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_SR_REVN % TYPE,
X_CRRNT_CNTRCT_FD_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_FD_REVN % TYPE,
X_CRRNT_CNTRCT_BEV_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_BEV_REVN % TYPE,
X_CRRNT_CNTRCT_RM_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_RM_REVN % TYPE,
X_CRRNT_USD_EXCHNG_RT_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_USD_EXCHNG_RT % TYPE,
X_CRRNT_CNTRCT_OTHR_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_OTHR_REVN % TYPE,
X_CRRNT_CNTRCT_RSRC_REVN_IN GGATE_CT. GTT_S_DOC_QUOTE. X_CRRNT_CNTRCT_RSRC_REVN % TYPE,
LAST_UPD_IN GGATE_CT. GTT_S_DOC_QUOTE. LAST_UPD % TYPE)
BEGIN
IF (PREV_STS_CD == STAT_CD) then
END if;
INSERT INTO GTT_S_DOC_QUOTE)
ROW_ID,
STAT_CD,
PREV_STS_CD,
BU_ID,
CREATED,
X_CRRNT_TOT_AGRD_RMS,
X_CRRNT_TOT_BLCKD_RMS,
X_CRRNT_TOT_PCKDUP_RMS,
X_CRRNT_TOT_PCKDUP_AVGRT,
X_CRRNT_TOT_BLCKD_AVGRT,
X_CRRNT_CNTRCT_SR_REVN,
X_CRRNT_CNTRCT_FD_REVN,
X_CRRNT_CNTRCT_BEV_REVN,
X_CRRNT_CNTRCT_RM_REVN,
X_CRRNT_USD_EXCHNG_RT,
X_CRRNT_CNTRCT_OTHR_REVN,
X_CRRNT_CNTRCT_RSRC_REVN,
LAST_UPD
)
VALUES ('ROW_ID_IN',
"STAT_CD_IN,"
"PREV_STS_CD_IN,"
"BU_ID_IN,"
"CREATED_IN,"
"X_CRRNT_TOT_AGRD_RMS_IN,"
"X_CRRNT_TOT_BLCKD_RMS_IN,"
"X_CRRNT_TOT_PCKDUP_RMS_IN,"
"X_CRRNT_TOT_PCKDUP_AVGRT_IN,"
"X_CRRNT_TOT_BLCKD_AVGRT_IN,"
"X_CRRNT_CNTRCT_SR_REVN_IN,"
"X_CRRNT_CNTRCT_FD_REVN_IN,"
"X_CRRNT_CNTRCT_BEV_REVN_IN,"
"X_CRRNT_CNTRCT_RM_REVN_IN,"
"X_CRRNT_USD_EXCHNG_RT_IN,"
"X_CRRNT_CNTRCT_OTHR_REVN_IN,"
"X_CRRNT_CNTRCT_RSRC_REVN_IN,"
'LAST_UPD '.
);
INSERT INTO S_DOC_QUOTE_CT
(ROW_ID_OUT, STAT_CD_OUT, PREV_STS_CD_OUT, BU_ID_OUT, CREATED_OUT, X_CRRNT_TOT_AGRD_RMS_OUT, X_CRRNT_TOT_BLCKD_RMS_OUT, X_CRRNT_TOT_PCKDUP_RMS_OUT, X_CRRNT_TOT_PCKDUP_AVGRT_OUT,
X_CRRNT_TOT_BLCKD_AVGRT_OUT, X_CRRNT_CNTRCT_SR_REVN_OUT, X_CRRNT_CNTRCT_FD_REVN_OUT, X_CRRNT_CNTRCT_BEV_REVN_OUT, X_CRRNT_CNTRCT_RM_REVN_OUT, X_CRRNT_USD_EXCHNG_RT_OUT, X_CRRNT_CNTRCT_OTHR_REVN_OUT,
SELECT X_CRRNT_CNTRCT_RSRC_REVN_OUT ROW_ID), STAT_CD, PREV_STS_CD, BU_ID, CREATED, X_CRRNT_TOT_AGRD_RMS, X_CRRNT_TOT_BLCKD_RMS, X_CRRNT_TOT_PCKDUP_RMS, X_CRRNT_TOT_PCKDUP_AVGRT,.
X_CRRNT_TOT_BLCKD_AVGRT, X_CRRNT_CNTRCT_SR_REVN, X_CRRNT_CNTRCT_FD_REVN, X_CRRNT_CNTRCT_BEV_REVN, X_CRRNT_CNTRCT_RM_REVN, X_CRRNT_USD_EXCHNG_RT, X_CRRNT_CNTRCT_OTHR_REVN,
GGATE_CT X_CRRNT_CNTRCT_RSRC_REVN. GTT_S_DOC_QUOTE;
COMMIT;
end if;
end QUOTE_STS;I was wondering why I get this error even if I stated the PREV_STS_CD
What line do you think that you said PREV_STS_ID on? As far as I can see that the IF statement is the first mention of it in your code. My guess is that you mean PREV_STATS_ID_IN (goes the same for STAT_CD / STAT_CD_IN).
If you write
IF prev_sts_cd_in = stat_cd_in THEN NULL; END IF; do_something_here;
then "do_something_here" will be processed regardless of the IF condition. I think what you probably wanted was something like
IF prev_sts_cd_in = stat_cd_in THEN NULL; ELSE do_something_here; END IF;
Is it possible for the prev_sts_cd and the stat_cd null? The test above would not handle this.
Also, as others have mentioned, the first INSERT statement attempts to insert the strings like "ROW_ID_IN" you probably want to use the value of the ROW_ID_IN parameter, which is the reason why you get the error ORA-01858. I'm guessing here of course, but I took out the quotes.
That would make your code something like this:
CREATE OR REPLACE PROCEDURE quote_sts ( row_id_in ggate_ct.gtt_s_doc_quote.row_id%TYPE , stat_cd_in ggate_ct.gtt_s_doc_quote.stat_cd%TYPE , prev_sts_cd_in ggate_ct.gtt_s_doc_quote.prev_sts_cd%TYPE , bu_id_in ggate_ct.gtt_s_doc_quote.bu_id%TYPE , created_in ggate_ct.gtt_s_doc_quote.created%TYPE , x_crrnt_tot_agrd_rms_in ggate_ct.gtt_s_doc_quote.x_crrnt_tot_agrd_rms%TYPE , x_crrnt_tot_blckd_rms_in ggate_ct.gtt_s_doc_quote.x_crrnt_tot_blckd_rms%TYPE , x_crrnt_tot_pckdup_rms_in ggate_ct.gtt_s_doc_quote.x_crrnt_tot_pckdup_rms%TYPE , x_crrnt_tot_pckdup_avgrt_in ggate_ct.gtt_s_doc_quote.x_crrnt_tot_pckdup_avgrt%TYPE , x_crrnt_tot_blckd_avgrt_in ggate_ct.gtt_s_doc_quote.x_crrnt_tot_blckd_avgrt%TYPE , x_crrnt_cntrct_sr_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_sr_revn%TYPE , x_crrnt_cntrct_fd_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_fd_revn%TYPE , x_crrnt_cntrct_bev_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_bev_revn%TYPE , x_crrnt_cntrct_rm_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_rm_revn%TYPE , x_crrnt_usd_exchng_rt_in ggate_ct.gtt_s_doc_quote.x_crrnt_usd_exchng_rt%TYPE , x_crrnt_cntrct_othr_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_othr_revn%TYPE , x_crrnt_cntrct_rsrc_revn_in ggate_ct.gtt_s_doc_quote.x_crrnt_cntrct_rsrc_revn%TYPE , last_upd_in ggate_ct.gtt_s_doc_quote.last_upd%TYPE ) IS BEGIN IF prev_sts_cd_in = stat_cd_in THEN NULL; ELSE INSERT INTO gtt_s_doc_quote ( row_id , stat_cd , prev_sts_cd , bu_id , created , x_crrnt_tot_agrd_rms , x_crrnt_tot_blckd_rms , x_crrnt_tot_pckdup_rms , x_crrnt_tot_pckdup_avgrt , x_crrnt_tot_blckd_avgrt , x_crrnt_cntrct_sr_revn , x_crrnt_cntrct_fd_revn , x_crrnt_cntrct_bev_revn , x_crrnt_cntrct_rm_revn , x_crrnt_usd_exchng_rt , x_crrnt_cntrct_othr_revn , x_crrnt_cntrct_rsrc_revn , last_upd ) VALUES ( row_id_in , stat_cd_in , prev_sts_cd_in , bu_id_in , created_in , x_crrnt_tot_agrd_rms_in , x_crrnt_tot_blckd_rms_in , x_crrnt_tot_pckdup_rms_in , x_crrnt_tot_pckdup_avgrt_in , x_crrnt_tot_blckd_avgrt_in , x_crrnt_cntrct_sr_revn_in , x_crrnt_cntrct_fd_revn_in , x_crrnt_cntrct_bev_revn_in , x_crrnt_cntrct_rm_revn_in , x_crrnt_usd_exchng_rt_in , x_crrnt_cntrct_othr_revn_in , x_crrnt_cntrct_rsrc_revn_in , last_upd ); INSERT INTO s_doc_quote_ct ( row_id , stat_cd , prev_sts_cd , bu_id , created , x_crrnt_tot_agrd_rms , x_crrnt_tot_blckd_rms , x_crrnt_tot_pckdup_rms , x_crrnt_tot_pckdup_avgrt , x_crrnt_tot_blckd_avgrt , x_crrnt_cntrct_sr_revn , x_crrnt_cntrct_fd_revn , x_crrnt_cntrct_bev_revn , x_crrnt_cntrct_rm_revn , x_crrnt_usd_exchng_rt , x_crrnt_cntrct_othr_revn , x_crrnt_cntrct_rsrc_revn , last_upd) SELECT row_id , stat_cd , prev_sts_cd , bu_id , created , x_crrnt_tot_agrd_rms , x_crrnt_tot_blckd_rms , x_crrnt_tot_pckdup_rms , x_crrnt_tot_pckdup_avgrt , x_crrnt_tot_blckd_avgrt , x_crrnt_cntrct_sr_revn , x_crrnt_cntrct_fd_revn , x_crrnt_cntrct_bev_revn , x_crrnt_cntrct_rm_revn , x_crrnt_usd_exchng_rt , x_crrnt_cntrct_othr_revn , x_crrnt_cntrct_rsrc_revn , last_upd FROM ggate_ct.gtt_s_doc_quote; END IF; END quote_sts;
-
I have an external PLSQL procedure that dynamically creates a report out of the HTML tags that I then called an anonymous block APEX PLSQL. I'm making bad images with the following code:
in the external procedure. How do you get around that? (NOTE: the procedure is too big to store directly in the APEX)....
' < style td = "width: auto;" "padding: 0px 5px 0px ' > '. spc_rec. SPC_VIABILITY_STATUS. "< table > ' |
"< style td =" width: auto; " text-align: left; "padding: 0px 5px 0px" > ' | spc_rec. SPC_VIABILITY_REASON. "< table > ' | TD > < img src = "" #IMAGE_PREFIX #check2.gif "alt =" "/ > < table > '"
....
Thanks in advance
PaulP
Hi Paul,.
You can use the global variable of the APEX package below to get the image prefix in pl/sql. Of course, your procedure should be in APEX, schema analysis application.
APEX_APPLICATION. G_IMAGE_PREFIX
Kind regards
Hari
-
The PLSQL since Application Java procedure call
Hi all
I have a PLSQL procedure that I'm calling from a Java Application. When I call this procedure from an SQL Editor, I can pass in the parameters and the procedure executes successfully (which is inserts records in a table).
However, exactly the same procedure when it is called from an application Java does not seem to return the appropriate results, which is to insert rows in a table.
Am I missing?
Is someone can you please advise me if I have to do something else as well for the PLSQL call work via Java.
Thank you
FM>
I have a PLSQL procedure that I'm calling from a Java Application. When I call this procedure from an SQL Editor, I can pass in the parameters and the procedure executes successfully (which is inserts records in a table).
However, exactly the same procedure when it is called from an application Java does not seem to return the appropriate results, which is to insert rows in a table.
Am I missing?
Is someone can you please advise me if I have to do something else as well for the PLSQL call work via Java.
>
Wrong forum!You need this post in the JDBC forum
https://forums.Oracle.com/forums/category.jspa?categoryID=288Either the procedure works correctly, or it does not; Java has NOTHING to do with it (unless it is written in Java).
If this does not work, then fix it.
If it works correctly then any problem you are having is due to your Java code and/or how the code calls the procedure.
Mark this question ANSWER and repost in the JDBC forum. When you post, provide:
1. your 4 digit Oracle version
2. your client OS and version.
3. the full JDK version
4. the name and the version of the jar file OJDBC that you use
5. the Java code that watch/product problem
6. the procedure signature indicating the names and types of the parameters -
Data not entered in af:table inside the panelCollection
Hello
I created a simple page that shows the result of a ViewCriteria. BUT when I click on the search button, data is not loaded in the table instead when I click View-> Show All (or any attribute) of panleCollection while data is loaded inside the table.
I created the table inside panelCollection. I want just the result to display in the table when I click search.
Looks like I'm missing something :-(
Please advice.
Concerning
SameerOK, I see your problem.
Here is my solution:
(1) use an af:query with table to start
(2) select the table in the window of the structure
(3) right click and select "Surround with...» "and select af:panelCollection. You can do this directly by hand if you want.
(4) select the af component: query in the structure window and open the property inspector. You should see that the 'ResultComponentId' in the 'Common' section has a red border. This is because the Table that contains the result of the query is now in a different naming container. Click on the arrow down on the right side and the search for the table that is now inside the panelCollection (this is the same work that I described with the partial trigger) and select it.
(5) save your work and run the page.You now have an af:query with table inside a panelCollection
Here is the code that results in my test scenario:
Timo
-
In a table - looping through the rows and the stored procedure call
APEX version: 3.2.0.00.27
Hello
I searched the forum and tried a few things but could not make it work.
I have a tabular presentation, developed with the help of the ATD ( )
What I'm trying to do now:
-After submit and validations, loop through all the lines and
-call a stored procedure passing 3 parameters obtained from each of the lines on the form of tables. This procedure will be an update of a database table.
On the forum, I found that I could do the loop "* FOR i IN 1..." APEX_APPLICATION.g_f03. "LOOP COUNT *" syntax.
Only for testing purposes, I tried just to view information with the following (On Load - after a footer) process (example of Denes Kubicek == > http://deneskubicek.blogspot.com/2009/05/execute-javascript-throuhg-plsql.html):
The foregoing would give me a ' * ORA-01403: no data found * ' message. I tried through various variants of APEX_APPLICATION.g_f0* #*, but still can't get anything to display correctly. In commenting on all the lines referring to APEX_APPLICATION.g_f0x above, the date would be are they displayed fine.declare v_today varchar2 (200); begin -- :P40_test := APEX_APPLICATION.g_f03(1); -- :P40_test2 := APEX_APPLICATION.g_f04.COUNT; :P40_test2 := 100; v_today := to_char (sysdate, 'dd.mm.yyyy'); --FOR i IN 1.. APEX_APPLICATION.g_f03.COUNT LOOP :P40_test := APEX_APPLICATION.g_f02(2); HTP.p ('<script type="text/javascript">'); HTP.p ( 'alert(''Today is ' || v_today -- || APEX_APPLICATION.g_f04(APEX_APPLICATION.g_f03(i)) || '.\n' || 'end!'');' ); HTP.p ('</script>'); -- :P40_test := APEX_APPLICATION.g_f02(APEX_APPLICATION.g_f02(i)); --END LOOP; end;
I tried uncomment the FOR... LOOP and play with the code (defining the process runs "On submit - after calculations" and Validations), I got was a ' * ORA-06502: PL/SQL: digital error or value: character conversion number error * "message.
Here is the script of the form in a table:
Regarding the parameters for the stored procedure, it would the MSLINK, VALVE_NUMBER and the VALVES_STYLE. FEATURE.select "V"."MSLINK", -- hidden (number) "V"."INSTALLATION_DATE", -- editable date picker "V"."MANUFACTURER_INDICATOR", -- editable (cascading LOV -- text) "V"."MODEL_INDICATOR", -- editable (cascading LOV -- text) "V"."DIAMETER_INDICATOR", -- editable (LOV -- number) "V"."PURPOSE_INDICATOR", -- editable (LOV -- text) "V"."VALVE_NUMBER", -- shown but not editable -- number "V"."MODIFY_DATE", -- shown but not editable "V"."MODIFY_USER", -- shown but not editable "V"."VALVES_STYLE"."FEATURE" -- shown but not editable -- number from "#OWNER#"."VALVES" "V" Where "V"."PROJECT_ID" = :P1_PROJECT_NUMBER AND "V"."VALVES_DFLAG" = 0
Help, please!
(Sorry for the long post).
Thank you
TanHi, Tan,
I have not seen that type of object - I've only used custom types for purposes of test years ago and have never used their within Apex!
One possibility is that the value of checksum being is based on all of the content of these fields, rather than only the part of the FEATURE. If there are other parts of the object, you could include those items as well.
Otherwise, as you f01 KP for a record, you will need to retrieve the values of the FUNCTION in your PL/SQL code directly from the table (because the user cannot modify these fields, you can be sure that the values in the table will be still valid).
Andy
-
How the repeating table inside a control valve?
Hello
Does anyone know how to make the repeating table inside a control valve in LabWindow CVI? I see that there is option for a Panel to scale content in resizing, but not available for a tab control. Any ideas?
Thank you very much!
Weiming
I don't know, I understand what you're trying to do, but you can set ATTR_SCALE_CONTENTS_ON_RESIZE on each tab panel.
GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, & tabPanel);
SetPanelAttribute (tabPanel, ATTR_SCALE_CONTENTS_ON_RESIZE, 1); -
12.1.3 jdev
I have a few large tables inside the af af:showDetailItem: panelTabbed. My panelTabbed has the left position. In this case, I don't see the horizontal scroll bar under my long tables. The horizontal scroll bar is on the tab all.
But if I have the position of the panelTabbed as noted above, I see the horizontal scroll bar under each long tables.
Is this behavior as expected or something I was wrong to do that?
Thank you.
Finally, I figured out how to make the design that I desired using all these elements of page layout. The design requirement is to have tabs on the left side, see the vertical scroll bar if the content of the tab is too long and display the horizontal scroll bar if the table has too many columns.
I have panelGroupLayout with layout of scroll inside panelTabbed showDetailItem, have all my panelBoxes w tables inside this panelGroupLayout. In this way I am able to get the vertical scroll bar when the contents of the table have too many lines.
By removing the facet ceter of panelStretchLayout panelGroupLayout and having the region inside the facet Center directly, each layer of extendable any inherent layout. I am able to get the horizontal scroll bar below each long table inside panelBox.
It is important to know how to layout components layer.
Thank you.
-
Droping a table from within a procedure by passing the name of the Table as an Argument
HII All
I want to remove a table from a procedure dynamically passing the table name as a parameter of a procedure manual
to do this, I wrote the following procedure
CREATE OR REPLACE PROCEDURE DEL_TAB (TAB_NAME IN VARCHAR2) AS
V_TAB_NAME VARCHAR2 (10);
V_STMT VARCHAR2 (50);
BEGIN
V_TAB_NAME: = TABLE_NAME;
V_STMT: = 'DROP TABLE' | V_TAB_NAME;
RUN IMMEDIATELY 'V_STMT ';
DBMS_OUTPUT. PUT_LINE(V_TAB_NAME||) e TABLE DELETED ');
END DEL_TAB;
but whenever I'm execute it gives me an error
ERROR on line 1:
ORA-06550: line 1, column 15:
PLS-00357: Table, view or sequence of reference 'A' not allowed in this context
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Please tell me the solution...
Thanks in advance
Alisson
Why do you want to implement this procedure? If you want to remove a table just issue the DROP of stand-alone statement. Why write a procedure for this? Also you must understand the difference between REMOVE and DROP in the context of RDBMS. You either use them which is incorrect. DELETION is to remove rows from a table and DROP is to remove the database table.
And with regard to your problem
> RUN IMMEDIATELY 'V_STMT ';
This should be
immediately run v_stmt;
You closed the V_STMT variable is in single quotes. You must remove the apostrophes.
-
Not able to manage the value 'Table Type' in my procedure, humble need help here
Hi all
I am facing a problem with below pl/sql block. The time I run it it works fine, but when I run the procedure only from the exact values (hardcoded), it throws error as below.
[Error] Execution (38: 1): ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in the call to 'CREATE_ABNORMAL_BY_TRADER '.
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
What I understand problem is, I use a Type of table herewhich works very well with my Pl/Sql block, but do not work when I run the same procedure of the value hard-coded.
Please guide me how to handle this situation.
Pl/Sql block [works absolutely well]:
Declare
lv_eff_from_dt DATE;
lv_eff_to_date DATE;
v_severity_codes_wl param_tbl: = param_tbl();
lv_algo_id_wl sagedbo.alerts.algo_id%TYPE;
Begin
lv_eff_from_dt: = sage_utility.get_transaction_date('EFF_FROM_DATE'); -' 05-Aug-2013. '
lv_eff_to_date: = sage_utility.get_transaction_date('EFF_TO_DATE'); -' 04-sep-2013. '
lv_algo_id_wl: = sage_utility.get_code_values('ALERT_MODELS','GRAY_LIST'); -GLABNORMALv_severity_codes_wl: = sage_utility.get_multi_parameter_value(1,'SEVERITY_CODE_WL'); -4.5
SONARDBO.sage_generate_alert.create_abnormal_by_trader (lv_algo_id_wl, v_severity_codes_wl, lv_eff_from_dt, lv_eff_to_date, 'US');End;
Pl/Sql block [does not] (by the way the same values but hard)
Begin
SONARDBO.sage_generate_alert.create_abnormal_by_trader ('GLABNORMAL', '4', 5, 5 August 2013 ', ' 04-Sep-2013', 'US');
End;
Error PLS-00306: wrong number or types of arguments in the call to 'CREATE_ABNORMAL_BY_TRADER '.
I'm sorry that my question is not so generic, you cannot run on your computer. How should just guide me with the concept, I treat the values in table hardcodedly? (For testing of use)
Thank you very much
If your passage of type table, then you will need to run as below
Begin
SONARDBO.sage_generate_alert.create_abnormal_by_trader ("GLABNORMAL", param_tbl (' 4 ', ' 5'), August 5, 2013 ', ' 04-Sep-2013', 'US');
End
Means that you must call with the table type ("' hard coded values"). Here is the simple test. Take a look at this
SQL > CREATE or REPLACE the TYPE nt_tab IS TABLE OF VARCHAR2 (50);
2.
Type of creation.
SQL > CREATE OR REPLACE PROCEDURE test_proc (p_nttab nt_tab)
2 AS
3 v_nttab nt_tab: = p_nttab;
4 BEGIN
5 FOR me in 1.v_nttab. COUNTY
6 LOOP
7 DBMS_OUTPUT. Put_line (v_nttab (i));
8 END OF LOOP;
9 END;
10.
Created procedure.
-Perform the procedure with only one value of type table
SQL > EXEC test_proc (nt_tab ('KING'));
KING
PL/SQL procedure successfully completed.
-Run procedure with the multi-value table type
SQL > EXEC test_proc (nt_tab ('KING', 'AAAA', 'BBBB'));
KING
ABDELKADER
BENAMER
PL/SQL procedure successfully completed.
Post edited by: 000000
Post edited by: 000000
-
Unable to describe the table as a user of the system
Hello
I am able to describe the bribes as user sys, but not able to do as a user system.
SQL > desc IA_MBR_ID_D;
Name Null? Type
----------------------------------------- -------- ----------------------------
MBR_ID_EDW_SK NOT NULL NUMBER
MBR_ID NOT NULL CHAR (3)
MBR_SBSCR_ALTN_ID NOT NULL VARCHAR2 (13)
MBR_LST_NM VARCHAR2
MBR_FRST_NM VARCHAR2
MBR_MID_INIT VARCHAR2
DATE OF MBR_EFF_DT
DATE OF MBR_CANC_DT
DATE OF MBR_BTH_DT
MBR_GNDR_CD NOT NULL CHAR (1)
MBR_RLNSP_CD NOT NULL CHAR (1)
MBR_TYP_OF_CONTR_CD NOT NULL VARCHAR2 (3)
MBR_UNIQ_MBR_ID NOT NULL VARCHAR2 (26)
MBR_SHRT_UNIQ_MBR_ID NOT NULL VARCHAR2 (16)
SQL > conn system/...@ < DB >
Connected.
SQL > desc IA_MBR_ID_D;
ERROR:
ORA-04043: object IA_MBR_ID_D does not exist
NOM_SEGMENT SEGMENT_TYPE OWNER
--------------------------------------------------------------------------------- ------------------ ------------------------------
IA_MBR_ID_D TABLE EDW
IA_MBR_ID_D TABLE EDWSTG
Please, share your ideas. Don't know if it's a question of privilege that I am not able to decrease this as a system user.
Kind regards
VNHello
You must precede the name with the name of the table owner describin while there. Try as follows while connected as user SYSTEMdesc edw.IA_MBR_ID_D desc edwstg.IA_MBR_ID_D
This table is so two schemas edw and edwstg. In the SYS schema, you could have a synonym created for one of above 2 tables and so you are able to describe without using the name of the owner as prefix. Use suite question to find out what tables in the SYS schema sysnonym points to.
select owner,synonym_name,table_owner,table_name from dba_synonyms where synonym_name = 'IA_MBR_ID_D';
Salman
-
Unexpected token: the error that occur inside a stored procedure
I get an unexpected token error when you try to compile the following stored procedure. The error occurs on the run pk_proof.pr_ProofAssets inside the stored procedure exec statement. No reason?
CREATE OR REPLACE PROCEDURE MONTHLY_ASSET (ln_business_dt_num IN NUMBER DEFAULT NULL, missing_tbl_name OUT NOCOPY VARCHAR2) IS ln_business_dt_num NUMBER; missing_tbl_name VARCHAR2; no_tbl_name_found EXCEPTION; bad_date_value EXCEPTION; counts_not_matched EXCEPTION; BEGIN IF ln_business_dt_num < 0 THEN RAISE bad_date_value; ELSE Select MAX(business_dt_num) into ln_business_dt_num FROM sasor.dp_ca_proof; if missing_tbl_name IS NOT NULL then raise no_tbl_name_found; end if; exec pk_proof.pr_ProofAssets('SLH_DST_ASSET', ln_business_dt_num, 'sasor_batch');
Remove 'exec '.
Maybe you are looking for
-
Hp12c: Hp12C computing simple without taking account of the first entry
0.7 / ((1 +(7/3) (1-0, 35))Enter 0.71 enterEntry 73. tap/1 enter0.35-*+/= 0.4The correct answer should be 0.28, for some reason any the calc ignores the first entry (0.7)
-
Micro have a lot of noise on Satellite Pro U400-13O
Hi there and Happy New 2009 Toshiba Satellite Pro U400-13O, I bought a week ago and found out that the built-in microphone have a lot of noise when I talk via Skype for example. I tried changing the driver, but the problem still exists. What should d
-
ChrisJ4203 apologies, don't think.
-
Sampling frequency of adjustment for the analog output of sine
Hello I tried to do something very simple: using an analog output card PCI 6221 to produce a frequency 50 Hz sine curve. For this I used a Vi to create a curve sinus and different screws DAQmx. But I have trouble understanding the principle of virtua
-
The environment is Windows XP SP3 -Windows Update fails for these 2 updates -Fixit research and 'fixed' a problem to update storage location. -Windows Update still does not work -Download the update on Microsoft.com -Manual installation fails with 'A