ORA-04054 : using variable substitution for the database link name
Hi,
I need to use variable substitution for the database link name.
Here is my command :
declare
GET VARCHAR2(50);
begin
select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
for rec in (select * from [email protected]_GET_DESIGNATION)
LOOP
dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
END LOOP;
exception
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
:crd := -1;
end;
When I run this programm, I receive the error :
ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
When I replace :
for rec in (select * from [email protected]_GET_DESIGNATION)
by :
for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
I receive the error :
PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
What can I do to resolv my problem ?
Regards,
Rachel
What is the name of the DB Link and the name of the object you are selecting
from?
I find it easier to create a view on the remote object then use that in selects.
e.g,
Link Name = MyLink
Object_name = Addr_Loc
create or replace VIEW Rem_Addr_Loc AS
select * from addr_loc@mylink;
In the code I then use the view
begin
for C_Rec in (select * from Rem_Addr_loc)
loop
dbms_output.put_line('Rec: '|| C_Rec.Col1);
end loop;
end;
Similar Messages
-
FTPs connection error:When using Variable substitution for Directory path
Hi
I am transferring data from BI to xml file via PI: Here a Client proxy from BI sends the data to PI and the PI FTPs the XML file to a remote location. For FTP I am using FTPs SSL connection.
It was working fine untill I used Variable susbstitution to determine Directory path dynamically. I am using this because different xml files are intended to goto the different locations.
I did the variable substitution like this:
Target Message Structure:
---> Target Directory: %var1%
<?xml version="1.0" encoding="UTF-8" ?>
<MT_BI_EXTRACT_FILE>
<Header>
<Directory>/Customer</Directory>
</Header>
<Detail>
</Detail>
</MT_BI_EXTRACT_FILE>
And in the variable substitution I am doing it this way
payload:MT_BI_EXTRACT_FILE,1,Header,1,Directory,1
And the error I am getting is:
Attempt to process file failed with Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
Exception caught by adapter framework: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure.
Does anybody have some Idea of this ??
Regards
NainaHi,
I guess the problem is not with Variable Substitution..
Error when getting an FTP connection from connection pool:
So its a connection problem..
Also check the option Disable Security check and try again...
Try to check again if the interface is executing properly without Variable substitution and let us know..
Babu
Edited by: hlbabu123 on Jan 7, 2011 2:46 PM -
Variable selection issue can we use variable exit for the below problem
Hi experts,
i have query in which i have an infoobject which is a characterstic i have even set the sort property for that infoobject but when the variable screen comes up and when we go into the selection screen all the help values are not sorted in the way i have set them. for example
ihave project managers like below
A
B
C
D
E
F
G
H
instead of displaying in order above its displyaing in
H
A
G
C
B
D
F
How to set it right.
thanks and regards
Message was edited by:
Neel KamalHi
actually i have done the same thing its getting displayed in the bex analyzer but not in the protal.
thanks and regards
Message was edited by:
Neel Kamal -
Reciever File Adapter - Temp File Name Scheme using Variable Substitution
How can I create a temporary file that uses variable substitution?
We are having a problem with files merging when we write files using the "Use Temporary File" setting on the FIle Adapter. So two independent files are merging into a single file. We are not using the "Append" setting.
We would like to use a Temp File Name Scheme that would append the message id onto the temporary file name.
Using variable substitution we created a msgid variable. When added to the temporary file name using %msgid% the temporary file name is created with %msgid% in the name instead of the actual message id. We put the variable into the "File Name Scheme" as well and the end completed file used the message id in the name.
Any Ideas?
Thanks,
MattHI Matthew,
Why are you adding the message id into the temporary file??
I understand that you want the output of the filename to contain message id .. and hence you are using variable substitution for the same.
Temporary file name will anyways get overwritten by the actual file name (here the actual filename will be using variable substituion).
So i suggest to achieve your scenario you can add any name in the temporary file and maintain the desired filename you require as output in the variable subsititution.
Temporary File Name option actually acts as a lock - unlock mechanism from PI side while the file is getting written to the file server so that while PI is writting the file no third party application batch program picks it up.
I hope this helps.
Cheers
Dhwani -
Database link name does not work with JDBC.
Hi,
I am new to Oracle database. I run a query from a Java class and after waiting around 20 minutes then it returns "ORA-04021 timeout occurred while waiting to lock DBMS_LOCK" error. The query is:
select r2.EXTERNAL_ID, d.EXTERNAL_ID AS ISIMPORTED from (select external_id from results r1
where r1.*run_id = ?* and not exists
(select id from results@cdata where external_id = r1.external_id and run_id = r1.run_id)
order by r1.external_id) r2 left join dummymaindata d on r2.external_id =d.external_id;
In this query I use a database link to access another database. The strange thing is at least for me, if I use "@cdata" it always gets stuck for at least 20 minutes and end with an exception "ORA-04021 timeout occurred while waiting to lock DBMS_LOCK" but if I use any combination of the database link name instead of the "@cdata" for example "@CDATA", "@Cdata", "@cDaTA", "@CdaTa" etc., it works fine without any exception.
This starnge behavior is only with this query for using the database link name while with any other query it does not matter that how I do write the db link name.
Kindly answer.
Arshad..Hi,
1) What is your Oracle, JDBC driver, target Oracle (to which you are connecting through DB link) versions?
2) Are you using DBMS_LOCK somewhere in the code? PL/SQL procedures on the source/target servers?
3) Can you construct a complete reproducible test case? -
File to file with out message mapping and using variable substitution
Hi,
Can any one send me a scenario where we can have file to file scenario with out message mapping and where i can use variable substitution.
As of now i am using integrate configurations where i cant use variable substitution as the message does not reflect in integration engine. I need to populate time stamp between <filename><timestamp>.txt.pgp
I am as of now using configuration scenario.
The time stamp always writes before the last file extension.
Let me know your thoughts?
Thanks,
Chandra.Hi Chandra,
u can use the Variable substitution even without IR contents also(Mapping....).
in the receiver communication channel just specify the path u want to access for a value...
eg: filename payload:mt_name,1,records,1,name,1
and in th file name give it as %filename%.txt... or vt ever ur requirement
Babu -
Prompting for the database logon while opening the report in CMC
I created a report and saved in the Crystal server 2008 repository. I set the default Database configuration as
report > Schedule > Database Logon > set password
or tick "Use same database logon as when report is run" in Default Settings > Database Configuration.
But when I am click on View for the report still it is promting for the database loging name and password.
is there any other settings required for this.
Thanks
UnniMoving to BOE forums
-
Passing plsql parm to a sql statement in the procedure database link name
Would like to pass a parm that is the database link name to a stored procedure. I defined this as below. var1 is the name of the db link that I would like to pass
create or replace procedure proc1 (var1 in varchar2) as
cursor c1 is
select num,name,city from emp@var1;
However, this is getting a plsql error in the above code as bad bind variable, db link name expected.
Is there a method to pass a variable within a stored proc into a SQL statement that has a cursor ..
thanksHi,
Database links have to be hard-coded. If you really need to specify the database link at run-time, then you need Dyanmic SQL.
Why do you need to do this? How many databases are involved? Do you have new database links all the time? The more you can say about your business requirements, the more helpful we can be.
Are there only a couple of possible database links? If so, you might consider hard-coding each of them, and branching to the appropriate one in your code.
is the real variable here the environment (Development, Test, Production) that you're in? For example, do you need to use one database link in Development, a different one in Test, and a third in Production, but you don't want to change the code when you move from one environment to another? If so, you can try conditional comilation. -
Retrieve the message put in message header using variable substitution
hi,
i am using dynamic configuration to put some information in the message header.is it possible to retrieve the message using variable substitution and if it is possible then how it be done using variable substitution.
regards,
MeenakshiVariable Substitution does not allow you to read all the messaeg header elements only some of them can be read/ access....for more info on how to read the message header elements refer: /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
From the above blog:
When using Variable Substitution, only certain standard message header attributes can be used/accessed (e.g. sender_party,
sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id)
Better use Dynamic Configuration to read the parameters.
I am wondering why you need to read the message header parameters when you are putting them using Dynamic Configuration.....cant you just get the details from the dynamic configuration UDF itself?
Regards,
Abhishek.
Edited by: abhishek salvi on Dec 10, 2009 1:18 PM -
Use two indicators for the same variable in two different VIs
hello, I want to use two indicators for the same variable in two different VIs running at the same time
should I use global variables?? I want to avoid because I have lot of variables and it would takes too much memory,I tried with this code but the value of the second indicator is not updated
I tried to use the queue and it works but the problem is as i said previously that i have many variables shoud I use a queue for each one??
what should I do?
thank you in advance
cordialy
Attachments:
projet.zip 13 KBCrisSTine01 wrote:
hello, I want to use two indicators for the same variable in two different VIs running at the same time
I'm a huge fan of User Events to send updates to GUIs from who knows where.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Used variable substitution to substiture the field 'date' in file name
Hi gurus
I have used variable substitution to substiture the field 'date' (dd/MM/yyyy/hh/mm/ss) in the file name so when empty payload (a valid xml ) is generated by Message mapping then the communication channel is failing by showing the following error
File processing failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during
variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload
: date
As of now the business is not getting effected as the business scenarion needs only customer master data at the reciever side But when ever there is no custmer master data in the sourse side the message mapping is generating an empty payload and the communication channel is failing ( so it is an internal issue and is there any way which could solve the both (ie the business must not get effected and as well the communication channel must not fail)
any coments on this will be higly apreciated
thanks and regards
sandeepHi Sandeep -
Yes If you use the Variable substitution from the payload , that perticular field has to be generated in the target structure.
To handle this You can do the following:
Sourcefield --->exists -> IfThenElse-->TargetField
Where SourceField>exists(node function)-> If
SourceField -
>Then
CurrentDate(Date Function)----->Else
Hope this will help !!
Regards.
Jeet. -
ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
Hi All,
I am trying to start my oracle 11g database on windows 7 PC and i am getting below exception
SQL> startup mount
ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
ORA-48140: the specified ADR Base directory does not exist [d:\oracle\app\product\11.2.0\dbhome_1\database\<oracle_base>]
ORA-48187: specified directory does not exist
OSD-00002: additional error information
O/S-Error: (OS 123) The filename, directory name, or volume label syntax is incorrect.
SQL>
Earlier it was working fine. For learning purpose, i have created spfile using pfile and after that i got this issue.
Please help.
Regards,
Sunilsunil907 wrote:
Hi,
I have provided diagnostic_dest folder location (physical path). Now i am getting some different kind of error on startup.
SQL> startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2182592 bytes
Variable Size 616563264 bytes
Database Buffers 444596224 bytes
Redo Buffers 5595136 bytes
ORA-00205: error in identifying control file, check alert log for more info
Please help
What does your own research of 'ORA-00205' indicate?
the text of the error message is pretty self explanatory .. it couldn't find the control file.
The control files are specified by the "control_files" initialilzation paramter. When you get this error, the instance has started but was unable to mount the control file. since the init file (spfile) was processed and the instance started you can easily see what it thinks are the control files.
oracle:fubar$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 16 12:51:37 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2217952 bytes
Variable Size 490735648 bytes
Database Buffers 339738624 bytes
Redo Buffers 2412544 bytes
ORA-00205: error in identifying control file, check alert log for more info
SQL> show parameter control
NAME TYPE VALUE
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/FUBAR/
controlfile/o1_mf_8ybx4t7w_.ct
x, /u01/app/oracle/flash_recov
ery_area/FUBAR/controlfile/o1_
mf_8ybx4tom_.ctl
control_management_pack_access string NONE
SQL>
So what did you do in fixing your original problem that caused your control_files parameter to go south? -
Variable substitution for Dynamic filename
Hi All,
my Scenario is Proxy to file. and the receiver file should be a zip file of extension .dat.gz.
In mapping I tried as below. In signature I used one sender and two receiver messages.
SENDER: RECEIVER:(2messages)
MT_Product MT_Product
-----Row ---------Row
---------field1 -----------field1
---------field2 -----------field2
---------field3 -----------field3
MT_Poduct_1
--------field5
for field5 I mapped current date and I am trying to use it in Reciver file communication channel. will that be correct to use?
In receiver communication channel the file name is Product_%field5%.zip I used
and I used Module Configuration for content conversion and Zipping the file.
In variable substitution I used field5 for dynamic date.
field5-----------
payload:Messages,1,Message2,1,MT_Product_1,1,field5,1
Module Confuguration:
Guys! am on right path????? will this be possible????Hello,
Why you are using multimapping? Just for defining target file name using var substitution - BTW, that too is incorrect. You cannot use Messages/Message 1 nodes in variable substitution.
Secondly, if I am not wrong the approach of defining dynamic zip file name using variable substitution won’t work because variable substitution will be executed once all the modules before standard call sap adapter gets executed. So during runtime, at var substitution step, ur file will actually be a text file instead of XML as a result u will get an exception.
So, if there is no specific objective of using multimapping then simply use DC.
Thanks
Amit Srivastava -
Hi Im new to XI and Im testing a simple file to file scenario by using Variable Substitution method.
PFB the input payload of my scenario:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:INF94145_Emp_Input_MT xmlns:ns0="http://infosys.com/xi/projects/adidas/n2">
- <Employee>
- <Details>
<Name>A</Name>
<ID>1</ID>
<Designation>SE</Designation>
<Salary>123456</Salary>
<DOJ>24-02-2008</DOJ>
<Other />
- <Address>
<City>Asd</City>
<ZIP>505001</ZIP>
<Country>India</Country>
</Address>
</Details>
</Employee>
- <Employee>
- <Details>
<Name>B</Name>
<ID>2</ID>
<Designation>SE</Designation>
<Salary>123456</Salary>
<DOJ>24-02-2008</DOJ>
<Other />
- <Address>
<City>Asd</City>
<ZIP>505001</ZIP>
<Country>India</Country>
</Address>
</Details>
</Employee>
</ns0:INF94145_Emp_Input_MT>
I used the variable substitution feature of Receiver File adapter to get the Output file name as one of the Field value from payload(Employee name in this case).
Now my question is can I be able to get the output files based on employee names.i.e.,for two employee details I should get two out files and for n employee details I should get n output files.
Can anyone tell how the above scenario could be done.
Thanks for your help.
Regards,
PrajwalHi,
I have used multi mapping and I tested the same and is working fine when I test in TEST tab present in mapping.
My scenario is a file to file and also I used same fields in input and output DT(datatype) for understanding purpose.
My input data type is as follows:
- <ns1:INF94145_Emp_Input_MT xmlns:ns1="http://infosys.com/xi/projects/adidas/n2">
- <Employee>
- <Details>
<Name>A</Name>
<ID>1</ID>
<Designation>qw</Designation>
<Salary>122</Salary>
<DOJ>2-22-2222</DOJ>
<Other>asasa</Other>
- <Address>
<City>asdsada</City>
<ZIP>12</ZIP>
<Country>dsada</Country>
</Address>
</Details>
</Employee>
But when coming to END to END testing I'm getting an error in IE as follows:
<SAP:Code area="MAPPING">GENERIC</SAP:Code>
<SAP:P1>Split mapping created no messages</SAP:P1>
Can anyone say what i have to do to overcome this problem.
Thanks and regards,
Prajwal -
Variable Substitution for Source Directory
Hello,
I have seen several threads about using a UDF and variable substitution for dynamically determining the Target Directory.
Is anyone familiar with (or had to implement) a solution where the Source Directory is dynamically determined.
My challenge is to connect to a different Source Directory name (sy-datum format, ex: 20070920 ) each day on an ftp site and download all the files in the folder to a know target directory. I am doing a simple file-to-file transfer, so no mapping is involved.
Your comments, suggestions and feedback is greatly welcomed.
Thanks,
RalphHello Carme,
I have not found a solution for this type of event.
I was attempting this because the FTP site I was connecting to would DELETE a file the moment XI touched it. So when XI (using FTP Transfer protocol) configured with a DELETE or ARCHIVE (Processing Mode), it would error off because the file was no longer on the FTP site. I contacted the site but they refused to deactivate their script to auto-delete files. Using TEST processing mode is not recommended per SAP in a server pool environment. You would think SAP XI would provide a fourth option in which a DELETE command is not issued back to the FTP site.
The FTP site did have sub-directories in which copies of the original files were stored, but I could not figure out how to dynamically change the XI Source Directory as the current date changed.
I settled on using File NFS (Transfer Protocol) and running the FTP commands from a .bat (batch file). I put the command I run down at the bottom of the XI page with a 60 second timeout.
I still do not change to each folder dynamically because the standard FTP (GET and MGET) commands do not attempt a Delete after file retrieval.
Perhaps using a batch file is an option you may want to consider using.
Cheers,
Ralph
Maybe you are looking for
-
How can i make my webpage has login and user has account
i have a project to do, i need user to sign up and have user account where they can check their data
-
I noticed that Phone call, is getting disconnected often while on the wheel.
Any one have noticed this problem while using your iPhone: While you are travelling (on the wheel) and attending a phone call, while your the cell phone receives signal from telecom network tower to tower, your phone call get disconnected automatical
-
Do i need to install 10gr1 before installing 10gr2
My assumption was that i don't need to install 10gr1 before installing 10gr2, but when i downloaded "10g Release 2 (10.2) for AIX 5L Based Systems (64-Bit)" from otn website, Its size was only 1.2GB and after i unzip and did cpio command, It only ext
-
Site properties set in Muse, appear wrong on the IPhone
Hi, I am creating a mobile site of my desktop flash version. "www.go-film.de". I love the idea of creating websides without any coding experience. So I start to translate the flash version, in a lighter html IOS copy. It works perfect, except the fac
-
Dear All, I would like to know. Can I create af:TreeTable with SQL Query without using Entity Object because of the Database allow to use only Query view object. Please show to me the ways how to tackle in this scenario. Regards KT