URI syntax issue.
Gday everyone,
The following snippet throws a URISyntaxException:Illegal character in query at index...
I can understand that it doesnt like he pipes in the url. Any ideas on how to overcome this syntactical problem besides removing the pipes?
try {
String uri =
"http://localhost:8080/crystal/ReportViewer.jsp?debug=off&report=reports//A4/01_CostCentreDefinitions_A4.rpt&prompt0=Test+Plan+PHS+COA&prompt1=|||||||||||1300";
Desktop.getDesktop().browse(new URI(uri));
catch (MalformedURLException e) {
e.printStackTrace();
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I have found a workaround. FYI the following snippet:
for (char c : new char[] { '|' })
uri = uri.replace(String.valueOf(c), (c < 16 ? "%0" : "%") + Integer.toHexString(c));
Similar Messages
-
Dynamic SQL from within DML - merging syntax issue #2
Further to my previous thread on a SQL - DML merging syntax issue, I have another problem with multiple conditions in the WHERE-clause:
vrb _retval decimal
vrb _val1 text
vrb _val2 text
_val1 = 'value1'
_val2 = 'value2'
SQL SELECT DIM1_ATTR1 FROM MYSCHEMA.DIM1_DIM WHERE COL1 = :_val1, AND COL2 = :_val2, INTO :_retval
The above SQL will return NA. If I use the text literals instead of the OLAP variables, the query just runs fine. Also, with a single condition (on COL1 only) the query returns the expected value.
A note in the help states that OLAP DML objects should clearly be sperated from the rest of the SQL but does not say how. I am using a colon before and a comma after as without them the line would not compile. I could not find any example that would use multiple conditions in the WHERE-clause however the help text indicates that it is possible.
Please help me, how.
Regards,
Csaba
Windows, Oracle10gRel2 Ver. 10.2.0.1.0 eversion: 84090It does work, although I applied the finishing touch by removing the commas as well!
Thanks a lot! Good job!
Could you please have a look at issue #1 too? :-)
Regards,
Csaba -
Documaker 12.1 XPath Syntax Issue
We are moving to Documaker Studio 12.1 from Docucreate 11.0. So, I am importing few forms into 12.1 and doing test runs. I ran into a XPath syntax issue. We use XPath manual triggers to trigger forms and sections.
In 11.0, the following trigger (use as Search Mask (True/False) in Manual Triggers) works perfectly fine. But it doesn't work in 12.1
*!/Acord/Bills/Form/[FormNumber='U61']FormNumber*
In 12.1, I have to remove the "/" present before "[" to make it work - as shown below.
*!/Acord/Bills/Form[FormNumber='U61']FormNumber*
Is there a way we can make the old syntax work with 12.1 as well? It would save us from changing thousands of Form and Section Triggers?
Thank you,
SGov.I suspect the short answer is No. The initial xPath syntax appears invalid as you would not define a slash between the node and the attribute that belongs to the node. The fact that it somehow succeeded was an anomaly that must have been corrected.
-
'How to..use reporting variables in BPS' syntax issue
Hi,
I am implementing the white paper 'How to...use reporting variables in BW-BPS' and I am getting a syntax error in the include YBW_BPS_VAR_READ. The error indicates 'Statement is not accessible' for my line:
SELECT SINGLE * FROM ybw_bps_var_map
ybw_bps_var_map being my transparent table as described in the white paper.
I have never seen such a syntax error, has anyone had the same issue? My code is the one in the white paper.
Thanks for any help.
DavidHi David,
I have the coding up and running. I have not seen this error before and don't know how to resolve it. If you cut&paste it from the PDF, then maybe some special characters got pasted into the ABAP editor. Try to delete the line and type it in manually.
Regards
Marc
SAP NetWeaver RIG -
SQL*Loader: Release 11.1.0.7.0 - Production on Thu Mar 18 07:21:37 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL*Loader-350: Syntax error at line 1.
Expecting keyword LOAD, found "ÐÏ".
ÐÏࡱá
^
My sqlldr file looks like this:
sqlldr control=C:\data\ctl\ss.ctl log=C:\data\logs\ss.log userid=User/Password errors=999 discard=C:\data\discard\ss.dis
control file looks like this:
LOAD DATA
INFILE 'C:\data\SS.TXT' "STR '\r\n'"
REPLACE
INTO TABLE SS
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
ACCOUNT_NBR CHAR,
ADDR1 CHAR,
ADDR2 CHAR,
ADDR3 CHAR,
ADDR4 CHAR,
CITY CHAR,
STATE CHAR,
ZIPCODE CHAR ,
more columns all of the are the same syntax column name and char
I can load this table using the enterprise manager but when using the sqlldr its not working.
Anything stand out?
Edited by: mlojan on Mar 18, 2010 5:33 AMOnly thing I can think of is there is some character set issue between the control file and the operating syste/oracle server.
You did you create the control file using a text based editor such as notepad or wordpad didn't you? You haven't used something like MS Word? -
Dear experts,
I have an issue with the stmt SUBMIT.
I have a custom program that runs in dialog mode thru which I need to call RSNAST00 program.
Can some one please specify the syntax to call this program such that it doesn't return with the success or failure messages, I do not want the user to see the message regarding the Idoc. Also, the program has to continue execution once the submit is done with out manual intervention.
Please suggest.
Here is how my systax is currently.
SUBMIT RSNAST00
WITH S_KAPPL EQ C_V2
WITH S_OBJKY EQ P_num
WITH S_KSCHL EQ C_Zabc
WITH S_NACHA EQ C_6
AND RETURN
-AmitHi Amit
I do not think that you're able to supress the messages coming out of RSNAST00. The only way I see is to submit RSNAST00 in background in synchrohous mode and return. Doing that way messages will be in spool instead of displaying to the user and you can delete spool in your program after calling RSNAST00 if any exists.
Regards
Dean Q. -
Hi,
I am getting syntax errors in below code,
D:/usr/sap/XIQ/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map98ec4020b05611dfa9e0005056a47072/source/com/sap/xi/tf/_MM_RSPD_INFILE_RSPD_OUTFILE_.java:165: cannot resolve symbol symbol : class string location: class com.sap.xi.tf._MM_RSPD_INFILE_RSPD_OUTFILE_ string out1 = contractNo + tmpqtystr1 + price + delperiod.substring(0,4)+"01" + condate + shipwts + mtype + cif + comtype + rejreason ^ D:/usr/sap/XIQ/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map98ec4020b05611dfa9e0005056a47072/source/com/sap/xi/tf/_MM_RSPD_INFILE_RSPD_OUTFILE_.java:177: cannot resolve symbol symbol : class string location: class com.sap.xi.tf._MM_RSPD_INFILE_RSPD_OUTFILE_ string out2 = out1; ^ 2 errors
is there any declaration issue..........
string out1 = contractNo + tmpqtystr1 + price + delperiod.substring(0,4)+"01" + condate + shipwts + mtype + cif + comtype + rejreason
+ type + usrname +impdate + imptime ;
int strlen = out1.length();
for (int s = strlen; s<178; s++)
out1 = out1.concat("");
string out2 = out1;
out1 = out1.concat(delperiod.substring(0,4)+"01");
result.addValue( out1 );
out2 = out2.concat(delperiod.substring(0,4)+"03");
result.addValue( out2 );Thanks a lot dude....
this did solved the issue........
lemme keep this post open.......
seems to be some logic issue.........
even the logic issue got solved...... thanks again....
Edited by: san485 on Aug 25, 2010 6:13 PM -
Destination URI causing issues
Hi!
I have a custom OA Framework page that has main page. On this main page, a field has an LOV. On this LOV, you are able to click on the quote field that pops up a new window showing quote lines associated with it. This is working perfectly but when I close the pop up window and select the record for the LOV, it returns to the main page and nothing is populated in the LOV field.
When I go to the LOV and don't open the pop up field, that LOV is populated.
My Destination URI is as follows:
javascript:void window.open('OA.jsp?page=/oracle/apps/xxcustom/b2bquote/webui/B2BQuoteLinesPG"eId={@QuoteId}&retainAM=Y&addBreadCrumb=Y')
I'm not sure if that is where the issue is but I'm a newbie and don't know where to really begin. This worked originally but we have now patched to RUP7 and it is no longer working for some reason.
Anyone have any clue?
Thanks!
Dougtake a look to your view Attribute. it may be not updateable. please select Updateable Alwais.
-
PHP visibility on local- syntax issue
I am changing my WYSIWYG from GoLive to Dreamweaver.
Imported my site, that has some header and menu includes in
php. The pages open with only the header include showing and
nothing on the page beyond (I just see the header inlcude on the
page, not the page design I'm working on) when I use
<?php include ('header_incl.htm'); ?>
When I change the code to
<? php include ('header_incl.htm'); ?>
I can see the design/layout of the page (with just a PHP
shield graphic for the includes), but I get a browser error on the
live site.
Is there a setting in Dreamweaver to be able to view the
page, with the syntax I'm using, on my local machine? If not, I'm
going to sacrifice my WYSIWYG cababilities, and I'm a designer, not
a programmer...
Thanks.jcamrud wrote:
> The include file validates out fine. As does the main
file.
You have a basic misunderstanding of how include files work.
The fact
that the two files validate independently is totally
irrelevant. Once an
external file is included, the *combined* code must validate.
> I did a basic test. Created a page with just an include
and a sentence. Same
> thing. Doesn't show me the sentence in Dreamweaver on my
local, but shows it
> on the live site.
Yes, that's browsers being tolerant of crap code. Dreamweaver
is not a
browser. It's designed to create standards-compliant code.
> However, I do get a yellow box on the local version of
the page that says
> </head>, above the include.
Yes, that's exactly what I expected would happen. The yellow
box is
Dreamweaver's way of telling you that you have incorrectly
nested tags.
A web page can have only one html tag, one head tag, and one
body tag.
When you use an include file, the *combination* of the two
must create a
single valid HTML document.
> If I take out the single quote marks within the inlcude
> <?php inlcude(header.htm); ?> it shows me the page
with the php-shield-graphic
> placeholder, but it doesn't recognize the include on the
live version.
Stop playing around with the PHP code. What you're creating
is
syntactical nonsense.
The problem that you have encountered is probably the most
common cause
of mistakes with include files. Strip the html, head, and
body tags out
of your include file, and everything should fit together just
fine and
dandy.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
This is a weird one!!!
I am using Dreamweaver/php/mysql and I am in the process of
developing the forms that edit articles that have been added to the
CMS. I have a page called edit.php which has the current list of
articles. Each article has a radio button next to it and have given
it an id of "id" (which is what I called it in the DB). On
selecting this article, and hitting submit, this should load up a
editnews2.php. On editnews2.php I have a filtered recordset that
filters on "id " so that it loads the article selected into the
editnews2 form. I have bound the fields in the form to the related
fields in the recordset.
When I test this out using the TEST button, in the recordset
pop-up window and enter an id, it retrieves the correct article
from the database. However, when I do it using the forms, I get an
error:
"You have an error in your SQL syntax; check the manual that
corresponds to your Mysql server version for the right syntax to
use near " at line 1"
This is really weird because the recordset works and
retreives the data no problems, which mean the connection file path
is correct and other parameters are correct. I have tried lots of
times to try and figure this out but I am now really stuck.
Could anyone shed some light on this one?
regards
orange22orange22 wrote:
> When I test this out using the TEST button, in the
recordset pop-up window and
> enter an id, it retrieves the correct article from the
database. However, when
> I do it using the forms, I get an error:
>
> "You have an error in your SQL syntax; check the manual
that corresponds to
> your Mysql server version for the right syntax to use
near " at line 1"
What that means is that the way Dreamweaver is building your
query
contains a mistake - probably an extra quotation mark or
something like
that.
Go into Code view and use echo to display the actual SQL
query being
sent to the database. That will give you a clue as to where
to start
troubleshooting the rest of the code.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Syntax issue when having more than 20 warnings
Hello,
when having more than 20 warnings in a compilation unit (package, procedure ...),
SQL Developer ( version 1.5.0.53)
doesn't always flag an error (like, for example, a misspelled local variable),
so instead of a compile-time error a runtime error is generated.
I tried to reproduce the situation and here is a simplified case where i've
encountered the same error.
Best regards
Alexander Andris, Prague
[email protected]
CREATE OR REPLACE
PROCEDURE PROC AS
l_arg1 pls_integer;
l_arg2 pls_integer;
-- declarations which issue PLW-07204 warnings ...( 20 or more ...)
cursor c1 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
cursor c2 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
cursor c3 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
cursor c4 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
cursor c5 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
cursor c6 is
select sysdate from dual
where trunc (sysdate) = trunc(sysdate);
procedure proc1 is
begin
null;
end;
BEGIN
l_arg_notdef := 42;
-- next line would not be displayed.
dbms_output.put_line (
'Error in SQLDev 1.5.0 - error on the assignment line not flagged '
|| ' by the compiler when preceded by > 20 warnings ...' ||
' (Error not shown in navigator.Same behavior also in SQLDev 1.21 ...).');
-- So, when lines 5 - 23 are commented out then line 31 is flagged as an
-- error (PLS-00201), otherwise not (runtime error only).
-- When working on a large package with more than 20 warnings and a lot of
-- code, to find an error like a misspelled local variable one would need to
-- a different IDE.Hope it is not difficult to fix this quickly ...
-- Details:
-- client platform: Windows XP
-- SQLDev: Version 1.5.0.53 Build MAIN-53.38
-- db.: Oracle 10.2 on Windows
END PROC;Unfortunately, that's the intended behaviour.
After complaining about errors not being reported in previous versions, they did add the "Only first 20 issues are reported" warning, but unless you know that can happen, almost nobody will notice.
I keep advocating for reporting errors on top, next any warnings, until having used up the 20 spaces. If necessary, they could compile first with warnings turned off, then again with warnings turned on.
I don't think I ever put a request for this on the SQL Developer Exchange, so take a look there if you're up for it.
Also mind you can turn the warnings off yourself inside the preferences, so they won't bother (nor help) you again.
Regards,
K. -
Day-date placeholder syntax issues
Hi,
Can someone clarify the legal syntax of the day-date placeholder. The published syntax in the OSB Reference Guide does not appear to be correct. I'm trying to script the configuration of backup schedules using the obtool 'mksched' command for a large rollout. I've tried several apparently legal forms of day-date, with the following observations.
1. days with an upper-case first letter do not work.
2. a day range, e.g. monday-tuesday does not work.
3. anything that includes more than a single day must be quoted with single quotes. If not, I end up with a schedule called "wednesday", where my day-date is tuesday<space> wednesday.
I've not tried all of the examples in the reference guide, but it would not supprise me if most of them do not work. The one 'mksched' example in the reference guide rather unhelpfully uses "-d thursday", which of course does work, being the simplest form of the syntax.
Thanks.You're right, the weekday range syntax as given in the reference guide doesn't work. I guess someone needs to fix that, or remove it from the doc.
You can do this to achieve the same result :
obtool mksched -d "mon tue wed" <schedule_name>
The schedules are kept in /usr/local/oracle/backup/admin/config/schedule, so once you've got a base, you might find it easier to manipulate them directly in there. -
Tryo to customize LKM File to Oracle (SQLLDR) customized - syntax issue !
Hello All,
I have to modify a little the step "Generate CTL file" of the LKM File to Oracle to get a correct ctl file...
I want to test the datatype of the column. If this is the column of type "DATE", I want to add the dateFormat to apply...
Here is the original line of the KM :
*<%=snpRef.getColList("", "[CX_COL_NAME]" , ",\n\t", "","")%>*
Here is my custom code. I try to test fi the DEST_DT is of type Date and if yes, I want to add the following text "to_date(:[CX_COL_NAME], 'YYYY-MM-DD'"
*<%=snpRef.getColList("", "[CX_COL_NAME]"<?if ("[DEST_DT]".equals("DATE")){>? " to_date(:[CX_COL_NAME], 'YYYY-MM-DD')" <?}?> ," ,\n\t", "","")%>*
Here is the result that I want to get (in bold, the date column) :
OPTIONS (
SKIP=1,
ERRORS=1,
DIRECT=FALSE
LOAD DATA
INFILE "C:\caljef\countryfilesDB/20080702.txt"
BADFILE "C:\caljef\countryfilesDB/Country_File.bad"
DISCARDFILE "C:\caljef\countryfilesDB/Country_File.dsc"
DISCARDMAX 1
INTO TABLE ODITEMP.C$_0COUNTRY_FILES
FIELDS TERMINATED BY X'09'
TRAILING NULLCOLS
C1_RC,
C2_UFI,
C3_UNI,
C4_LAT,
C23_SORT_NAME,
C24_FULL_NAME,
C25_FULL_NAME_ND,
C26_MODIFY_DATE *"to_date(:C26_MODIFY_DATE, 'YYYY-MM-DD')"*
How to insert an "if" in the the getColList function ? I put the * <? and ?> * operators, but it seems not to work....
And How do I deal with the quotes... if I want to add quotes in my text, should put double quotes ?
I get this type of error when executing this code :
com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Erreur lors de l'interprétation de la syntaxe d'une tâche
Tâche :5
+java.lang.Exception: BeanShell script error: Parse error at line 2, column 5. Encountered: [ BSF info: Generate CTL file at line: 0 column: columnNo+
+ at com.sunopsis.dwg.codeinterpretor.a.a(a.java)+
+ at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)+
+ at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)+
+ at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)+
+ at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)+
+ at com.sunopsis.dwg.cmd.e.i(e.java)+
+ at com.sunopsis.dwg.cmd.g.y(g.java)+
+ at com.sunopsis.dwg.cmd.e.run(e.java)+
+ at java.lang.Thread.run(Thread.java:619)+
Thanks a lot for your Help !!!Hello CTS,
Again thank you for your help.
Unfortunately, it does not work. There's improvement, now I can execute the code without errors.
But the CTL file genertad is still incorrect.. :-(
The IF equals... statement seems to be is ignored. The code always runs through the else.
I tried to display the value of DEST_DT, and that's correct, the field is of type "DATE".
Here the file generated by with the code you send me :
:C20_LC,
:C21_SHORT_FORM,
:C22_GENERIC,
:C23_SORT_NAME,
:C24_FULL_NAME,
:C25_FULL_NAME_ND,
:C26_MODIFY_DATE
And here is the file that I would get :
:C20_LC,
:C21_SHORT_FORM,
:C22_GENERIC,
:C23_SORT_NAME,
:C24_FULL_NAME,
:C25_FULL_NAME_ND,
:C26_MODIFY_DATE *"to_date(:C26_MODIFY_DATE, 'YYYY-MM-DD')"*
The solution should not be far..... but I can't fin the right syntax !! It's become crazy!
Any other Idea ?
thanks for help
glains -
Hello Experts,
The following UDV code works until I add the WHERE clause, at which time I get a syntax error near keyword WHERE:
DECLARE @x INTEGER
SET @x = $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage'
SELECT CASE
WHEN @x BETWEEN 1 AND 19 THEN 10
WHEN @x BETWEEN 20 AND 39 THEN 20
WHEN @x > 39 THEN 30
END
(This is basically retrieving a value from column 2 of a matrix where column 1 has a value of 'Mileage'.)
SELECT $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage' works as a separate query, but I cannot get that functionality into my above code.
RegardsSolved, just needed to bracket it into a subquery.. could have sworn I tried that...
SET @x = (SELECT $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage') -
Oracle type table passing in a procedure - Syntax issue
Hello,
I am trying to call the PROCEDURE INSERT_CCR_HISTORY from the PROCEDURE InsertCcr_Staging_DEBBIE.
I wnat to pass the table to the INSERT_CCR_HISTORY procedure to insert into the table. I don't have the correct syntax.
Can any one help with the syntax.
Thanks.
Jaffee
PROCEDURE INSERT_CCR_HISTORY (vTable vName) IS
BEGIN
declare
i number := 0;
begin
FORALL i IN 1..vTable.COUNT
insert into ccr_staging_history
ccr_staging_history_deb.CCR_ID,
ccr_staging_history_deb.BATCH_ID,
ccr_staging_history_deb.MODIFIED_BY,
ccr_staging_history_deb.MODIFIED_DATE,
ccr_staging_history_deb.ENTERED_BY,
ccr_staging_history_deb.ENTERED_DATE,
ccr_staging_history_deb.DUNS,
ccr_staging_history_deb.DUNS_PLUS4,
ccr_staging_history_deb.CAGE_CODE,
) -- end of values for insert
values
v_next_seq.NEXTVAL , -- v_n(i).CCR_ID,
1, --batch_id null,
NULL, -- modified_by
NULL, -- modified_date
v_user, -- entered_by
sysdate, -- entered_date
vTable(i).DUNS,
vTable(i).DUNS_PLUS4,
vTable(i).CAGE_CODE,
); -- end of value session
COMMIT;
end;
END INSERT_CCR_HISTORY;
PROCEDURE InsertCcr_Staging
IS
BEGIN
declare
TYPE vName IS TABLE oF got_r_num%ROWTYPE;
v_n vName;
cursor outer_lp IS
select distinct(error_vid) error_vid from got_r_num
order by 1;
CURSOR check_duns_etall(p_vid IN VARCHAR2, p_dunsall IN VARCHAR2) IS
Select count(*)
FROM got_r_num
where error_vid = (p_vid)
AND lower(duns||duns_plus4||cage_code||tax_payer_id) = lower(p_dunsall);
v varchar2(100) := NULL;
xt NUMBER := 0;
v_dunsetall varchar2(1000) := NULL;
v_val NUMBER := 0;
v_val_duns NUMBER := 0;
v_user varchar2(30) := SYS_CONTEXT('USERENV','SESSION_USER');
bEGIN
for i in outer_lp LOOP
v := i.error_vid;
SELECT * BULK COLLECT INTO v_n FROM
got_r_num where error_vid = v;
FOR i in 1..v_n.LAST LOOP
IF v_n.count > 1 and v_n(i).SITE_TYPE = 'PURCH' THEN
v_dunsetall := v_n(i).DUNS||v_n(i).DUNS_PLUS4||v_n(i).CAGE_CODE||v_n(i).TAX_PAYER_ID;
OPEN check_duns_etall(v,v_dunsetall);
FETCH check_duns_etall INTO v_val;
CLOSE check_duns_etall;
v_num := i;
IF v_val = 1 THEN
-- insert
-- Populate ccr_staging_history
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_n ); -- calling procedure to Insert. SYNTAX problem ???
END IF;
end if;
END LOOP;
END LOOP;
end;
END; -- end of procedure InsertCcr_StagingGreetings,
I am receiving the following error message.
'17:38:39 Error: PACKAGE BODY DCAMERON.CCR_MIGRATION_DEBBIE
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND table of records"
Do I have the correct syntax for calling the procedure? Inside the procedure for inserting is this the correct syntax?
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_n );
Thanks.
Jaffee
{code}
CREATE OR REPLACE PACKAGE BODY DCAMERON.CCR_MIGRATION_DEBBIE AS
PROCEDURE MAIN_debbie IS
BEGIN
CreateTempTableNew_debbie;
InsertCcr_Staging_DEBBIE;
END;
PROCEDURE CreateTempTableNew_DEBBIE IS
BEGIN
declare
cnt number := 0;
BEGIN
EXECUTE IMMEDIATE q'[CREATE TABLE dcameron.TEMP_got_r_num
AS
WITH got_cnt AS
SELECT po_ccr_staging.ccr_id,po_ccr_staging.duns,po_ccr_staging.duns_plus4,po_ccr_staging.cage_code,
COUNT (1) OVER ( PARTITION BY po_ccr_staging.error_vid,
po_ccr_staging.error_vsid
) AS cnt -- End of COUNT analytic clause
FROM dcameron.po_ccr_staging,
dcameron.vms_cfs_association vass,
dcameron.vendor_detail ven
WHERE ven.vendor_id = vass.cfs_vendor_id
AND ven.vendor_no = vass.cfs_vendor_no
AND vass.vendor_id = TO_NUMBER (po_ccr_staging.error_vid, '999999999')
AND vass.vendor_site_id = TO_NUMBER (po_ccr_staging.error_vsid, '999999999')
AND ven.address_type IN ( 'CCRDSB', 'CCRPUR')
), -- end got_cnt
temp_got_r_num AS
SELECT got_cnt.ccr_id,got_cnt.duns,got_cnt.duns_plus4,got_cnt.cage_code,
ROW_NUMBER () OVER ( PARTITION BY vendor_id,
vendor_site_id
ORDER BY got_cnt.ccr_id DESC,
cnt DESC
) -- End of ROW_NUMBER analytic clause
AS r_num
FROM got_cnt
) -- end got_r_num
SELECT n.ccr_id,n.duns,n.duns_plus4,n.cage_code
FROM TEMP_got_r_num n
WHERE r_num = 1
ORDER BY vendor_id,
vendor_site_id,
n.ccr_id,
n.duns,
n.duns_plus4,
n.cage_code,
n.tax_payer_id ]';
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE got_r_num';
EXECUTE IMMEDIATE 'ALTER TABLE TEMP_GOT_R_NUM RENAME to got_r_num';
EXCEPTION WHEN OTHERS THEN NULL;
END;
end;
end; -- END OF PROCEDURE -- CreateTempTableNewD_DEBBIE
PROCEDURE InsertCcr_Staging_DEBBIE
IS
BEGIN
declare
TYPE vName IS TABLE oF got_r_num%ROWTYPE;
v_n vName;
cursor outer_lp IS
select distinct(error_vid) error_vid from got_r_num
order by 1;
CURSOR check_duns_etall(p_vid IN VARCHAR2, p_dunsall IN VARCHAR2) IS
Select count(*)
FROM got_r_num
where error_vid = (p_vid)
AND lower(duns||duns_plus4||cage_code||tax_payer_id) = lower(p_dunsall);
v varchar2(100) := NULL;
xt NUMBER := 0;
v_dunsetall varchar2(1000) := NULL;
v_val NUMBER := 0;
v_val_duns NUMBER := 0;
v_user varchar2(30) := SYS_CONTEXT('USERENV','SESSION_USER');
PROCEDURE INSERT_CCR_HISTORY (vTable vName) IS
BEGIN
declare
i number := 0;
begin
FORALL i IN 1..vTable.COUNT
insert into ccr_staging_history_deb
ccr_staging_history_deb.CCR_ID,
ccr_staging_history_deb.BATCH_ID,
ccr_staging_history_deb.MODIFIED_BY,
ccr_staging_history_deb.MODIFIED_DATE,
ccr_staging_history_deb.ENTERED_BY,
ccr_staging_history_deb.ENTERED_DATE,
ccr_staging_history_deb.DUNS,
ccr_staging_history_deb.DUNS_PLUS4,
ccr_staging_history_deb.CAGE_CODE
) -- end of values for insert
values
v_next_seq.NEXTVAL , -- v_n(i).CCR_ID,
1, --batch_id null,
NULL, -- modified_by
NULL, -- modified_date
v_user, -- entered_by
sysdate, -- entered_date
vTable(i).DUNS,
vTable(i).DUNS_PLUS4,
vTable(i).CAGE_CODE
); -- end of value session
COMMIT;
end;
END INSERT_CCR_HISTORY;
BEGIN
for i in outer_lp LOOP
v := i.error_vid;
SELECT * BULK COLLECT INTO v_n FROM
got_r_num where error_vid = v;
FOR i in 1..v_n.LAST LOOP
IF v_n.count > 1 and v_n(i).SITE_TYPE = 'PURCH' THEN
v_dunsetall := v_n(i).DUNS||v_n(i).DUNS_PLUS4||v_n(i).CAGE_CODE||v_n(i).TAX_PAYER_ID;
OPEN check_duns_etall(v,v_dunsetall);
FETCH check_duns_etall INTO v_val;
CLOSE check_duns_etall;
v_num := i;
IF v_val = 1 THEN
-- insert
-- Populate ccr_staging_history
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_n );
END IF;
-- -- insert
-- -- Populate ccr_staging_history
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_N );
else
IF v_n.count > 1 and v_n(i).SITE_TYPE = 'PAYMNT' THEN -- Do this check only for PAYMNT type
v_dunsetall := v_n(i).DUNS||v_n(i).DUNS_PLUS4||v_n(i).CAGE_CODE||v_n(i).TAX_PAYER_ID;
OPEN check_duns_etall(v,v_dunsetall);
FETCH check_duns_etall INTO v_val;
CLOSE check_duns_etall;
IF v_val = 1 THEN
-- insert
-- Populate ccr_staging_history
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_N );
END IF;
ELSE
if v_n.count = 1 then
-- insert
-- Populate ccr_staging_history
CCR_MIGRATION.INSERT_CCR_HISTORY ( v_N );
end if;
END IF;
END IF;
END LOOP;
END LOOP;
end;
END; -- end of procedure InsertCcr_Staging_DEBBIE
END; -- END OF PACKAGE
{code}
Maybe you are looking for
-
Is there a special version of iTunes with QuickTime Player for 64 bit Windows PCs?
-
Is there a reason why the lightning bolt that lets you add dynamic content to a <select> list box has disappeared? Is there some other way of doing this now?
-
Hello, I am trying to create an array of JCheckBox objects. Here is the code. I do not get any error message with the javac command then the Applet doesn't work. Something is wrong but where? Thanks in advance Christos import javax.swing.*; impo
-
E-commerce gateway setup for PO Outbound
I am trying to configure E-commerce gateway in R12.1.1. I have completed Trading partner setup.( As per the Implementation guide) While i am trying to export a PO using - OUT: Purchase Order (850/ORDERS) program i am getting a blank file. Would appri
-
My MacBook Pro won't start. What do I do?
I press The power on button and The screen Lights up and the Apple logo appears. The little circle at th center of the screen begins to rotate. I wait and wait and nothing else happening. What's wrong?