SQL & PL/SQL :: Accept Input And Output To Screen - Getting ORA-06550 Error
Jan 18, 2011
I am trying to accept three numbers and one string as input, and then display the values on the screen. I don't understand why I am getting these errors.
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 id_number NUMBER := &id_number_input;
3 trans_num NUMBER := &trans_num_input;
4 remar VARCHAR2(75) := &remark_input;
5 receipt NUMBER := &receipt_input;
[Code] .....
ERROR at line 4:
ORA-06550: line 4, column 24:
PLS-00201: identifier 'HELLO' must be declared
ORA-06550: line 4, column 8:
PL/SQL: Item ignored
ORA-06550: line 10, column 61:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 10, column 2:
PL/SQL: Statement ignored
View 3 Replies
ADVERTISEMENT
Nov 21, 2012
Here's my table structure:
<h4><font color="Blue">CREATE TABLE "SSPFUSER05"."PERSONS"
( SSN NUMBER(13,0),
PIN VARCHAR2(7 BYTE)
);</font>
</h4>
And here's my procedure below:
<h4><font color="Blue">
CREATE OR REPLACE
PROCEDURE SP_SSN_BY_PIN(
V_REQUESTEDPIN IN VARCHAR2,
V_SSN OUT CHAR)
AS
BEGIN
SELECT
[code]....
As you can see the type of the SSN column is NUMBER(13,0). But I leftpad it with 0 and assign it to my output paramter V_SSN, whose type is CHAR. But I get 111196100099 instead of 0111196100099. I've tried TO_CHAR(LPAD(SSN,13,'0')) but still doesn't work. However, if I return the left padded SSN inside a SYS_REFCURSOR I get what I want.
View 1 Replies
View Related
Nov 18, 2010
Procedure: CREATE OR REPLACE procedure test (a number, b varchar2) is
begin
dbms_output.put_line(a ||'->'||b);
end;
Anyonymous Block:
begin
exec test(1,'m');
end;
/
When i run this i am getting this error
ORA-06550: line 2, column 7:
PLS-00103: Encountered the symbol "TEST" when expecting one of the following
[code]...
View 5 Replies
View Related
May 18, 2011
how can i get the output format from given input table
View 2 Replies
View Related
Sep 13, 2012
I am using regexp_substr to break the pipe delimited string. Want to use the output as the NUMBER input to a cursor.Its not working and not getting any error also.
Here is an example.
initial input : '5545|4124|12456'
using the sql below to break the string into columns.
select regexp_substr('5545|4124|12456','[^|]+', 1, level)) from dual
connect by regexp_substr(, '[^|]+', 1, level) is not null;
But when i try to pass the output of the above query to a cursor with input defined as number, its not accepting. I tried using to_number for the output of above query.
View 12 Replies
View Related
Jan 26, 2012
create table a_user
(
u_name varchar2(30)
, grp varchar2(30)
)
;
INSERT INTO a_user VALUES ('abc', 'new');
[code].....
sql:
SELECT
a.grp
, a.g_tot
FROM a_user b
,
(
SELECT
[code].....
getgrpname is a function to get grp when I input the u_name
Now I want to create a proc to display the output from the sql when I give the p_u_name as input. I am thinking some thing like this:
create or replace procedure get_u_name_data (p_u_name IN VARCHAR2, rc_data OUT SYS_REFCURSOR) IS
IS
BEGIN
OPEN rc_data FOR
SELECT
a.grp
[code].....
how to print output in SQL developer
View 2 Replies
View Related
Nov 30, 2011
I have little code that's don't really works.
InputStream is = null;
OutputStream os = null;
Connection conn = null;
Blob value = null;
[code]......
I know that there is 90% of Java code. But I have few questions:
I know that I can insert date using INSERT. But is it possible that I can use SELECT and JAVA will know that it need to update the SELECTED column ?
View 6 Replies
View Related
Oct 4, 2011
when i am calling stored procedure with input and output parameters from batch file .. I am getting the following message ..
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 4 11:48:51 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 14
code which i have written ...
DEClARE
RETCODE NUMBER;
RETMSG VARCHAR2(200);
EXEC SP_SELCT_EMPLOYEE_DATA(277080,'EMPNAME ','EMAIL@EMAIL.COM', 9028045686,111333,25000,'PUNE',35,RETCODE ,RETMSG );
EXIT
Procedure Name :
PROCEDURE SP_SELCT_EMPLOYEE_DATA (
-- A_EMPLOYEE_ID IN VARCHAR2,
--A_JOB_ID IN EMPLOYEES.JOB_ID%TYPE,
P_EMPLOYEE_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE,
P_EMPLOYEE_NAME IN EMPLOYEES.EMPLOYEE_NAME%TYPE,
P_EMAIL IN EMPLOYEES.EMAIL%TYPE,
[code]....
View 2 Replies
View Related
Jul 9, 2012
While I try to download a file using the below code; an HTTP 404 error is coming although the proc is being called and the parameter is correctly being passed.
create or replace procedure download_myfile1(p_id in number)
as
v_mime varchar2(255);
v_length number;
[code]...
It shows a POP up window by which u can save or opens the file. But no pop up displayed in this case.
View 7 Replies
View Related
Oct 15, 2013
i need a script which can take input from a file and give output to other txt file, something like below :
input.txt
001
002
003
004
Query:
select name from employee where employeecode=<ENTRY FROM INPUT.TXT FILE>
Result should go to OUTPUT.TXT File.
View 7 Replies
View Related
May 17, 2013
On Windows 7 I've created a DBCA from Script to automate the DB creation of identicall databases.I executed the bat from cmd.exe which I started as Administrator
On script xdb_protocol.sql when catqm.sql was called, the cmd stoped
it asks for a value "Give a value for 4 one:" (In german actually "Geben Sie einen Wert f³r 4 ein:" )
http://img62.imageshack.us/img62/1145/tempin.jpg
Its for *:user_opt_secfiles := '&4'*; shall be YES or NO it doesnt auto-set. What shall I put?
[code]....
View 5 Replies
View Related
Nov 17, 2011
I trying to Assign XML content to the clob variable inside the pl/sql block, But i am getting the Below Error:
declare
t clob;
begin
t := 'xml content exceeds 32000 characters'
update test
clob_cloumn = t;
where id =2;
exception
when others then
null;
End;
ORA-06550: line 5, column 4:
PLS-00172: string literal too long
I need to handle this exception, i know it length exceeds 32000 characters, but even though i need to handle the exception and to perform other operation after handling the exception.
View 5 Replies
View Related
Apr 10, 2013
I am trying to resolve by using a cursor C2 inside the already existing cursor C1, i will use a inner loop to get the select statement value to cursor c2 then i will assign the vlaues the variables, then once i read all the values of cursor c2 i will exit inner loop and go to outer loop to read the next value of c1 and then again go to cursor c2 and inner loop.
I have pasted the code below.
Declare
temp1 source.source%type;
temp2 QUOTE_LETTERS_MASTER%rowtype;
Cursor c1 is
Select * from Source;
[code]...
View 5 Replies
View Related
Aug 15, 2013
I have a problem with the code below. I would like to define a variable (exrate1) which I would like to use in another script. Also, the variable should be different for every month(that's why timestamp is between some period).
The problem is that I receive some errors which I don't know haw to fix
View 8 Replies
View Related
Feb 21, 2011
I am facing the below mentioned error with .net framwork and oracle.
PL/SQL: ORA-02185: a token other than WORK follows COMMIT
ORA-06550: line 1, column 7:
PL/SQL: SQL Statement ignored
View 3 Replies
View Related
Jul 11, 2013
I am learning Regular expression I am solving one problem with regular expression. I am creating a table while inserting I have to restrict punctuation character.
create table emp
(
ename varchar2(30) ,
constraint ck_ename check ( regexp_like (ename , '[^[:punct:]]')));
and also how I can remove double space.
View 8 Replies
View Related
Aug 15, 2012
i nee a function which accepts 4 digit number and in four digit number the number should not be repeated. i want all the number in the output.
ex:1234
2367
1262(is not valid)
View 20 Replies
View Related
Jul 20, 2012
I am running rep_1, and before executing second rep_2 the user should enter department number, after accepting department no, the second rep_2 should be executed. But after accepting parameter the second rep_2 is not displaying any record.
View 1 Replies
View Related
Oct 25, 2011
i was asked to built a report file that will run from oracle form using web. show_document() built-in object to produce a data extract. the objective is to built a dynamic SQL and use that to a cursor.
CREATE OR REPLACE PROCEDURE pass_ref_cur(p_cursor SYS_REFCURSOR) IS
TYPE array_t IS TABLE OF VARCHAR2(4000)
INDEX BY BINARY_INTEGER;
rec_array array_t;
BEGIN
FETCH p_cursor BULK COLLECT INTO rec_array;
FOR i IN rec_array.FIRST .. rec_array.LAST
LOOP
dbms_output.put_line(rec_array(i));
END LOOP;
END pass_ref_cur;
[code]....
I found out that the procedure can only accepts a single column. When I run this code it works fine because I am using a single column on the SQL statement.
DECLARE
rec_array SYS_REFCURSOR;
BEGIN
open rec_array For 'select p.muni from chips.project p, chips.proj_type pt where p.type = pt.id';
pass_ref_cur(rec_array);
CLOSE rec_array;
END;
The objective is to use a multiple column. How can I revised the procedure pass_ref_cur so that it can accept multiple columns?
View 17 Replies
View Related
Mar 23, 2012
The Utility should have a procedure that will be able to accept a schema and table name and produce CSV file for that table.
This is what i have so far:
CREATE OR REPLACE Procedure print_table (schema_name varchar2, tab_name varchar2) IS
BEGIN--begin procedure
DECLARE
vpath varchar2(100) := 'C:UsersUserDocumentsDocsDBAProject';
[code].....
It works outside of the procedure but the nature of the question requires a stored procedure.
View 26 Replies
View Related
Oct 11, 2013
I have a plsql block construct where i want to use for loop dynamically , the query which for cursor for for loop will accept the table name from parameter and join them to return the result. the resultant data will iterate in loop and do the execution.
DECLARE
--initialize variables here
v_date varchar2(10);
v_rebuild_index varchar2(250);
v_sql VARCHAR2(250);
p_table_name varchar2(250) := 'DS_ABSENCE';
p_source_table varchar2(30) := 'STG_ABSENCE';
p_source_owner varchar2(30) := 'STG_SAP';
v_for_sql varchar2(1000);
[code]....
View 7 Replies
View Related
Apr 8, 2012
I'm trying to create a store procedure that will accept a username from a flat file but i don't know how to do read file into store procedure.
Below is a sample store procedure by itself i created to add user which created okay but when i execute I got the error displayed below.
create or replace procedure addUsers(userNam in varchar2)
is
begin
EXECUTE IMMEDIATE 'CREATE USER'||userNam||'IDENTIFIED BY "pass1234" DEFAULT TABLESPACE USERS'||'QUOTA "1M" ON USERS'||
'PASSWORD EXPIRE';
end addUsers;
/
[code].....
View 21 Replies
View Related
Jul 1, 2013
DECLARE
JOBSFILE UTL_FILE.FILE_TYPE;
-- TAKE ALL JOB TITLES FROM JOBS
CURSOR JOBSCUR IS
SELECT *
-- DDOCNAME,DDOCTITLE,DSECURITYGROUP,DDOCAUTHOR,DDOCTYPE,DINDATE,PRIMARYFILE,EXTRACTIONDATE,BATCH_ID
FROM TARGET_UCM ;
[code].......
this is my plsql here to print table values i am using many utl_file.put_line statements is there any way to print all table values in a single utl_file.put_line.
View 2 Replies
View Related
Sep 25, 2013
Currently I have a requirement where I need to create 2 more output rows using each result row.
In my requirement I am populating charges table with types of charges, on each line item of charges, I need to apply 2 types of taxes and populate it along with the charge line item. I will be storing charges in table charges and the 2 taxes to be applied in taxes table respectively. For each row of charges, i need to apply these 2 taxes present in taxes table resulting in 3 rows output.
--Create tables charges
create table charges
(
charge_type varchar2(10) ,
charge number
);
[Code]....
My expected output should be like below:
Item_type amount
-------------------- ----------
charge1 100
Charge1_tax1 10
Charge1_tax2 20
charge2 200
Charge2_tax1 20
Charge2_tax2 40
how I can achieve the expected output using a single sql query
View 6 Replies
View Related
May 14, 2011
i want to bypass the logon screen in forms 6i i have trigger but it not works.
View 1 Replies
View Related
Feb 3, 2012
I am developing menu.. in that menu having 5 different forms.. these forms are 3 one schema ( i.e X ) and remaining 2 forms are one schema ( i.e Y )..
i am calling x schema
form level trigger on_logoon :
onlogon('a','a@X');
a for Username and x database name and another form in form level trigger on_logon : coding
logout;
logon('b','b@Y');
b for Username and y database name
but the form is not executing and not saving the record's.
View 1 Replies
View Related
Aug 6, 2010
I have an form with a few canvases already in it. The problem is that I want to see a particular canvas which shows the toolbar at the top of the window but it dosent show up on the form. I checked the property palette and the canvas is visible. There is also an other canvas right at the top of the form. How do I move the other canvas down if this is covering the toolbar canvas. How do i move the canvas down as it dosent show any X position in its property palette.
View 1 Replies
View Related
Jul 1, 2010
how the forms webpage/forms screen can be center oriented which is by default top left oriented in the content webpage.
View 1 Replies
View Related
Mar 22, 2011
i am not able to get whole form on the screen. some part of the part is missing and even there is no scroll bar to slide the form. I have also change the form applet parameter..my screen size is 1024 x 768 and this is same as of the size of form applet.
View 1 Replies
View Related
Mar 21, 2013
I migrate some forms&reports 6i to 11g, i have some issues on screens. they are
1.In some of the migrated screens the prompts are not properly aligned. In some cases the Prompts which were in bold are converted to regular fonts.
2.The font size have increased, due to this the data are not completely visible in the fields. Do we have any provision for reducing the font size so that this gets applied for all the screens instead of changing the font size in each screen?
3. In case of Push buttons the names of the buttons are not fully visible.
4.The reports are not getting generated if we access the Application using Google chrome.
View 5 Replies
View Related