Help to slove the Date Format Problem in a procedure
Hi Guys...
After i joined this fourm... i really learned a lot... actually i am working as much as i can...now i am thinking so logically... i am able to write a procedure in a day,... can u belive... my first one took 5days... second was 3... now 1day...i am happy for my progress... but still i am lost sometimes... Now i wrote a procedure
Prefectly executed without any errors.... Really this is the first time i wrote something without errors....usually they will be 100's of them...
anyways now i am trying to pass some values like this
end;
*
ERROR at line 4:
ORA-01840: input value not long enough for date format
ORA-06512: at line 3
I know what the error is... but i am not able to eleminate it....
i gave f_year in date formate so it takes by default dd-mom-yyyy but i am pass only yy in my values....thats the problem... i tried to put to_char(f_year ,'yy') date in the procedure but thats also giving me some errors... and i am lost....
Please give me some hints to work it out plzzzzz.... as tomm i need to submit the procedure to webserver...frontend is waiting for my procedure... plzzz some hint or i dont mind if u give me solution itself...
3 MEXICO_NAFTA_CERTIFICATE_EXT('0048', '00254101', '11', '03');
+ --- This is not a date ------------------------------^
...and does not fit here:
Procedure MEXICO...(..., f_year date)
You must provide the parameter values exactly like the parameter type.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Well thats the problem... the input form front end will be 03 and if i take f_year as number then when i equate it with the dates in where clause of cursor with dates.... its giving error.... whats should i do... who night i scrached my brain no idea.... please help me out.....
already tried and got error as
SQL> declare
2 begin
3 MEXICO_NAFTA_CERTIFICATE_EXT('0048', '00254101', '11', '03');
4 end;
5 /
declare
*
ERROR at line 1:
ORA-01821: date format not recognized
ORA-06512: at "FTA_SOURCE.MEXICO_NAFTA_CERTIFICATE_EXT", line 56
ORA-06512: at line 3
so i tried changing code in line 56 which is a fetch in the loop to
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE MEXICO_NAFTA_CERTIFICATE_EXT:
LINE/COL ERROR
-------- -----------------------------------------------------------
56/1 PL/SQL: SQL Statement ignored
67/1 PLS-00306: wrong number or types of arguments in call to
'TO_CHAR'
I tried all possible ways that comes to my little brain no now ideas left
SQL>
SQL> declare
2 begin
3 MEXICO_NAFTA_CERTIFICATE_EXT('0048', '00254101', '11', '03');
4 end;
5 /
declare
*
ERROR at line 1:
ORA-01722: invalid number
ORA-06512: at "FTA_SOURCE.MEXICO_NAFTA_CERTIFICATE_EXT", line 56
ORA-06512: at line 3
SQL> desc fta.SAP_CERTIFICATES_EXTRACT_VIEW
Name Null? Type
----------------------------------------- -------- -------------
CERTIFICATE_NBR NOT NULL NUMBER
ORG_ID NOT NULL VARCHAR2(4)
CUSTOMER_NBR_SUFX NOT NULL VARCHAR2(2)
CUSTOMER_NBR_BASE NOT NULL VARCHAR2(8)
PART171 NOT NULL VARCHAR2(40)
HTS_CDE VARCHAR2(12)
ORIGINATING_IND NOT NULL VARCHAR2(1)
ISO_COUNTRY_CDE NOT NULL VARCHAR2(2)
BASIS_CDE VARCHAR2(1)
PRODUCER_CDE VARCHAR2(1)
CERT_CDE VARCHAR2(1)
REGIONAL_VALUE_CONTENT_CDE VARCHAR2(1)
PART_NBR NOT NULL VARCHAR2(40)
EFFECTIVE_DATE NOT NULL DATE
EFFECTIVE_FROM_DATE NOT NULL DATE
EFFECTIVE_TO_DATE NOT NULL DATE
TRANSACTION_DATE NOT NULL DATE
INACTIVE_IND CHAR(1)
...You must provide the parameter values exactly like the parameter type.
Make sure all parameters/variables are the SAME TYPE!
In the procedure you declare these parameters as NUMBER, but then you call the procedure with the same as CHARACTER and in the table, they are also defined as CHARACTER:
f_org_id NUMBER,
f_customer_nbr_base NUMBER,
f_customer_nbr_sufx number,
....
ORG_ID NOT NULL VARCHAR2(4)
CUSTOMER_NBR_SUFX NOT NULL VARCHAR2(2)
CUSTOMER_NBR_BASE NOT NULL VARCHAR2(8)
So, what's the deal?
I beleive that by now you get the picture, good luck!
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Bookmarks