almost, use this:
SET LINESIZE 500
if you want to make the columns smaller use the column command.
e.g. to get a text field from 100 down to 20 you wuold type:[COLOR=blue]
column my_column format a20
Isn't it just a case of you incorrectly referencing the variable, you have used it as if you are bringing back a record. Therefore
12. DBMS_OUTPUT.PUT_LINE('NAME1 : ' || name1.EName);
should actually be
12. DBMS_OUTPUT.PUT_LINE('NAME1 : ' || name1);
[COLOR=black]
shouldn't it?!?
You said previously:
IN_Month is an argument passed to this proc and also the name of a column from tbl_base. Is this correct?
if IN_Month is a field in the table - is it a character field? If its a number field then maybe the parameters is getting passed rather than the field value (but I...
...easier):
v_value tbl_base.jan%TYPE;
v_Month Char(5);
v_Month := 'v_' || p_IN_Month;
then the rest of your code should be changed as follows (/* is a marker to start a multi-line comment and */ ends the multi-line comment, just in case you are wondering...):
/* you don't need to use...
You appear to have reverted back to code that won't work, but you were right, the code I gave you wouldn't work as I messed it up a bit at the end (sorry - I'm only human)
You need to put this:
EXECUTE IMMEDIATE 'Update tbl_base set ' || IN_Dest_Month || ' = ''' || v_Month || ' where ........'...
You could use dynamic SQL:
branch_string char(10);
branch_string := '1,2,3,4';
EXECUTE IMMEDIATE 'select *
from branch
where branch_id in (' || branch_string || ')';
Where is the invalid column - i.e. I don't think it will be the substituted IN_Dest_Month - I think it will be in your where clause.
Can you send the error message? alternatively - just create another table and insert a row into it, then update this procedure to write to that table and run the...
Almost:
EXECUTE IMMEDIATE 'Update tbl_base set ' || IN_Dest_Month ||' = ''' || v_Month'' where ........'
Don't use double quotes it is all single quotes
i.e.
[single quote]'Update tbl_base set [single quote} || IN_Dest_Month || [single quote] = [single quote][single quote][single quote] ||...
how about:
select a.index, min(a.column1 || a.column2 || b.column1 || b.column2)
from table a, table b
where a.index = b.index
and a.column1 <> b.column1
and a.column2 <> b.column2;
its not pretty - but hey, you didn't ask for beauty...
You're on-line now eh? - lets get down to business:
In the case you are on about above, you need to put:
text in bold is a string:
EXECUTE IMMEDIATE 'Update my_table set ' || my_text_field || ' = ''' || v_variable_containing_text || '''';
for this example above, say my_text_field contained...
I am hoping you have cut this down to make it a little easier to post as you don't open the 2nd and 3rd cursors anywhere but close them ???
You also have some redundant code in there - After you declare the procedure you have:
"AS
Begin
DECLARE"
all you need to put is...
lewisp is correct but I think you need to take it a litle further:
EXECUTE IMMEDIATE 'Update Incxxx.tbl_base set ' || IN_Dest_Month || ' = v_' || IN_Month || ' where year_id = ' || v_yearid || ' and unit_id = ' || v_unitid || ' and ver_id = ' || IN_Dest_VerID || ' and line_id = ' || v_lineid...
The line about commit from carp is very true but since you aren't creating anything IN your procedure you aren't making a call to CREATE and therefore aren't makeing an implicit commit - leave the commit in!!! The only time you are creating something is when you are actually creating the procedure.
Did the previous solution work - if not, are you typing this directly into SQL*Plus?
Your code looked fine at first glance (I haven't been through it with a fined tooth comb) but I have had problems in the past with trying to do multiple tasks in SQL*Plus without saving it to a file and then...
Hi,
Has anyone had any experience with upgrading oracle clients and forms and reports runtimes from any version to Oracle 9i? Our site is currently thinking about it and would like to know of any possible problems.
We want to get rid of the multiple versions of clients (7.3-2.5, 8.0, 8i...
A Java Bean would be pretty good, but you should be able to get away with just fully-qualifying the path of the file to point at a client PC, to get this you'd have to work out which client you are on when you make the request (I think this can be done via client-side scripts that sends a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.