Doubt regarding using variable in deq_condition (Queues)
I am using Oracle 11g in Linux Platform .
I am trying to dequeue a message based on a condition and the condition involves a variable .
DECLARE
l_enqueue_options DBMS_AQ.enqueue_options_t;
l_dequeue_options DBMS_AQ.dequeue_options_t;
l_message_properties DBMS_AQ.message_properties_t;
l_message_handle RAW(16);
l_event_msg event_msg_type;
worker_status VARCHAR2(30) := NULL;
worker_no NUMBER;
BEGIN
SELECT worker_no_seq.nextval INTO worker_no FROM DUAL;
l_event_msg := event_msg_type(worker_no, 'Hi', 'NEW', systimestamp, NULL);
DBMS_AQ.enqueue(queue_name => 'event_queue',
enqueue_options => l_enqueue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
l_dequeue_options.deq_condition := 'tab.user_data.worker_id = :worker_no AND tab.user_data.status=''DONE''';
DBMS_AQ.dequeue(queue_name => 'event_queue',
dequeue_options => l_dequeue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT
END;Here I am en-queuing a message which is dequeued by another procedure and some calculations are done based on the message and the message is enqueued back with same worker_id and status is updated as DONE . Now the code given above is a blocking call to dequeue the message with same worker_id and with status as 'DONE' . But since the condition involves a variable I am getting an error
ERROR at line 1:
ORA-01008: not all variables bound
ORA-06512: at "SYS.DBMS_AQ", line 335Let me know what should be done ?
The open_cursors value was set to default one ...50
I did try executing the same after setting it to 200 ...It ran fine
But I am not using any explicit cursor inside .
I am not very sure of what enqueue and dequeue procedures in DBMS_AQ do ...
The first and second procedures are as follows
FUNCTION execute_task(worker_no NUMBER) RETURN VARCHAR2
IS
l_enqueue_options DBMS_AQ.enqueue_options_t;
l_dequeue_options DBMS_AQ.dequeue_options_t;
l_message_properties DBMS_AQ.message_properties_t;
l_message_handle RAW(16);
l_event_msg event_msg_type;
BEGIN
l_event_msg := event_msg_type(worker_no, 'Hi', 'NEW', systimestamp, NULL);
DBMS_AQ.enqueue(queue_name => 'event_queue',
enqueue_options => l_enqueue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
l_dequeue_options.deq_condition := 'tab.user_data.worker_id = '||worker_no||' AND tab.user_data.status = ''DONE''';
DB MS_AQ.dequeue(queue_name => 'event_queue',
dequeue_options => l_dequeue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
RETURN l_event_msg.status;
END;
PROCEDURE get_a_task(worker_no NUMBER)
IS
l_enqueue_options DBMS_AQ.enqueue_options_t;
l_dequeue_options DBMS_AQ.dequeue_options_t;
l_message_properties DBMS_AQ.message_properties_t;
l_message_handle RAW(16);
l_event_msg event_msg_type;
BEGIN
l_dequeue_options.deq_condition := 'tab.user_data.worker_id = '||worker_no||' AND tab.user_data.status = ''NEW''';
DBMS_AQ.dequeue(queue_name => 'event_queue',
dequeue_options => l_dequeue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
l_event_msg := event_msg_type(l_event_msg.worker_id, l_event_msg.information, 'DONE', l_event_msg.start_time, systimestamp);
DBMS_AQ.enqueue(queue_name => 'event_queue',
enqueue_options => l_enqueue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
END;Let me know if I have to do any changes to the code .
Message was edited by:
user558969
Similar Messages
-
Doubt regarding using variable in deq_condition
I am using Oracle 11g in Linux Platform .
I am trying to dequeue a message based on a condition and the condition involves a variable .
DECLARE
l_enqueue_options DBMS_AQ.enqueue_options_t;
l_dequeue_options DBMS_AQ.dequeue_options_t;
l_message_properties DBMS_AQ.message_properties_t;
l_message_handle RAW(16);
l_event_msg event_msg_type;
worker_status VARCHAR2(30) := NULL;
worker_no NUMBER;
BEGIN
SELECT worker_no_seq.nextval INTO worker_no FROM DUAL;
l_event_msg := event_msg_type(worker_no, 'Hi', 'NEW', systimestamp, NULL);
DBMS_AQ.enqueue(queue_name => 'event_queue',
enqueue_options => l_enqueue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT;
l_dequeue_options.deq_condition := 'tab.user_data.worker_id = :worker_no AND tab.user_data.status=''DONE''';
DBMS_AQ.dequeue(queue_name => 'event_queue',
dequeue_options => l_dequeue_options,
message_properties => l_message_properties,
payload => l_event_msg,
msgid => l_message_handle);
COMMIT
END;Here I am en-queuing a message which is dequeued by another procedure and some calculations are done based on the message and the message is enqueued back with same worker_id and status is updated as DONE . Now the code given above is a blocking call to dequeue the message with same worker_id and with status as 'DONE' . But since the condition involves a variable I am getting an error
ERROR at line 1:
ORA-01008: not all variables bound
ORA-06512: at "SYS.DBMS_AQ", line 335Let me know what should be done ?It means you are not supply all required information.
Note that you have declared variables of built-in dbms_aq data types but not assigned a value to some of them. -
Regarding Formula Variable...
Hello guyz,
I am preparing for certifications. I have a doubt regarding Formula Variable. Can anyone please let me know with good and easy example so that i can understand the concept.
Thanks and Regards,
Hawkin.Hi Hawkin
check this link,
http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
hope it helps,
Sudhakar. -
Doubt regarding Adobe forms used for PCR
Hey all,
I have a doubt regarding Adobe forms used for PCR.If i goto tc
<b>SFP->form name (ISR_FORM_SPPM)->Layout->XML SOURCE-->
<base><server name><port>/sap/bc/fp/form/layout/</base></b>
But in tc SICF,i do not have anything beyond FP.It goes like this :<b> sicf-> default_host->sap->bc->fp</b> .
Could this be the possible cause of error why i am not able to view the forms in PDF format?
Can anyone , who has doen this before, please help me out with this issue?
Thanks,
AditiHi Aditi,
Are you getting an error when you are trying to access the PDF form ?
Is ADS installed and configured properly ? Also let me know the operating system you are using, it's version, J2EE and Portal version.
Regards,
Sunil -
Doubt about using automation testing in mtm and vs 2012
Hi
Ive a doubt in using mtm and vs 2012. I wanna test a software by automation method
1) whether i should record the steps in visual studio and attach the recorded file to mtm and test
or
2) can i record the script(steps) in mtm and run the automation testing in mtm, if you say yes what are the step.
Plz help me out for both 1 and 2 by tell the steps.
Thank you
Reguards
Pavan kumar RHi Pavan,
It is based on the detail requirement to choose them.
Do Coded UI test in visual studio 2012, we could record the action and playback, link tests to test case that in MTM, we also could base on the detail requirement to modify the code.
Do manual or automated test in MTM 2012, we also could record the action and playback, but can’t modify the code (need do it in vs), we could do automated tests in lab environment
# System Testing Your Application Using Microsoft Test Manager
http://msdn.microsoft.com/en-us/library/jj635157(v=vs.110).aspx
For the automated test in MTM, you could refer to these steps below:
Create tests
Check in TFS
Link test methods to test case
Queue a build
Create lab environment in mtm
Do automated test
More information, please refer to:
# Essential Guide for Running Automated Tests from a Test Plan
http://msdn.microsoft.com/en-us/library/ff472576(v=vs.110).aspx
If we record the action (script/steps) in the MTM, we could
playback the test, if we want do the automated test for that recording, we could generate the code in VS and link that test to the test case, after that we could do automated tests.
# Generating a Coded UI Test from an Existing Action Recording
http://msdn.microsoft.com/en-in/library/dd286652(v=vs.110).aspx
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Doubt regarding SHDB transaction
Hi All,
I have a doubt regarding the Process Tab in the application tool bar of SHDB transaction. What is the use of the following check boxes?
1) Default Size
2) Cont.after commit
3) not a batch input session
4) END: Not a Batch Input session
5) Simulate Background modeHi,
Basically these are the properties for CALL TRANSACTION using. You need not worry about these unless you really need those.
1) Default Size: it will set the Default screen size for CALL TRANSACTION USING...
2) Cont.after commit : it will set indicator that CALL TRANSACTION USING... is not completed by COMMIT. after commit also the process will continue
3) not a batch input session: sets indicator that present session is not batch input
4) END: Not a Batch Input session
5) Simulate Background mode : session will be run in foreground. but similar to back grpund
you can see the documentation by placing the cursor on these and click f1. -
I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the person who has stolen my macbook logs out of iCloud.
It should work fine for iPhone/iPad because we can enable "Restrictions" to prevent the user from signing out of iCloud. Do we have simialr settings for the macbook?
Thanks,If it's not on the device list, it indicates that someone has gone to Find My iPhone on icloud.com and manually deleted it from the device list (as explained here: http://help.apple.com/icloud/#mmfc0eeddd), and it has not gone back online since (which would cause it to reappear on the device list; Find My iPhone has been turned of in settings on the device; the iClolud account has been deleted from the device; or the entire devices has been erased and restored.
Unfortunately, there's no other way to track the phone other than through Find My iPhone. You could call your carrier and see if they would blackliste it so at least the theif couldn't use it. -
How to use variables in data slices?
Hello,
in BI-IP I have tried to use variables in a data slice.
The user should fill these variables.
How can one use and fill these variables?
Thank you
DanielHello Horst,
data slice is a very strong system lock. It is normally not a good decission to allow users to control this part becuse it sould be in administration of a responsible person.
If you allow users in the web to open or close data slices, this is like a "open period" funtion in financials: Think about what could happen, if anyone else than the responsible person could do that....
This is my point of view.
I would do it in anoter way: Create an User exit and fill a variable like desribed above. You read each line and make a decission whether the user might see this line or not (e. g. period open? yes or no?). The period and the status for the period could be maintained in a table or in a characteristic. table might be easier.
regards
Eckhard -
Using variables in the title of the graph
Hi Gurus,
I would like to use - for example a presentation- variable in the title of a graph.
I assign a value for that variable in dashboard prompt.
Does anybody know the syntax of using variable in the title of a graph
(Not in a Title view!)
Thanks in advance .
Regards
LaszloYou can reference presentation variables in the following areas :
Title Views
Narrative Views
Column Filters
Column Formulas
Conditional Formatting conditions
Chart scale markers.
Gauge range settings.
Static text.
Direct Database Requests
Dashboard prompts
iBot Headlines and text -
Hi All,
I am new to TestStand. Still in the process of learning it.
What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
Thanks in advance,
LaVIEWan
Solved!
Go to Solution.Hi,
Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
Regards
Ray Farmer -
How to get a field that using variable in order to create a query
Hi,
I found a difficulty when creating a query. so, I would like to ask you some question.
1. How to get a field that using variable which that field I want to put it in my query?
For example, I would like to take quantity field in inventory audit report. And when I put my cursor in
quantity field, there was only variable, item, etc. How to get this and put it in query?
2. How to combined the invoice quantity with inventory audit report quantity?
3. I have a query like this:
SELECT distinct T0.[DocDate] as 'Tanggal', T0.[DocNum] as 'No.Faktur', T1.[ItemCode] as 'Kode Barang',
T1.[Dscription] as 'Deskripsi', T1.[Quantity] as 'Quantity', ((T1.[LineTotal])/(T1.[Quantity])) as 'Harga
Satuan', T1.[LineTotal] as 'Harga Total', T3.[CalcPrice] as 'HPP Satuan', ((T3.[CalcPrice]) * (T1.
[Quantity])) as 'HPP Total', T4.[ItmsGrpNam] as 'Jenis Barang', T5.[SlpName] as 'Nama Sales', T1.
[WhsCode] as 'Kode Gudang' FROM [dbo].[OINV] T0 INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry =
T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OINM T3 ON T2.ItemCode
= T3.ItemCode INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod INNER JOIN OSLP T5 ON
T0.SlpCode = T5.SlpCode WHERE T3.[TransType] = '13' and T3.[CreatedBy] = T1.[DocEntry] and T0.
[DocDate] >=[%0] and T0.[DocDate] <=[%1] and T4.[ItmsGrpNam] =[%2] and T1.[WhsCode] =[%3]
Is it possible if I just take one invoice with invoice quantity and only show up at once although I have a
lot item cost for that item? (because I'm using FIFOmethod).
Please help me.. cause I'm stuck with this thing :l.
Thank you very much, and I'm waiting your respon soon.
Regards,
SiscaTry this one:
SELECT distinct T0.DocDate as 'Tanggal', T0.DocNum as 'No.Faktur', T1.ItemCode as 'Kode Barang',
T1.Dscription as 'Deskripsi', T1.Quantity as 'Quantity', ((T1.LineTotal)/(T1.Quantity)) as 'Harga
Satuan', T1.LineTotal as 'Harga Total', T3.CalcPrice as 'HPP Satuan', ((T3.CalcPrice) * (T1.
Quantity)) as 'HPP Total', T4.ItmsGrpNam as 'Jenis Barang', T5.SlpName as 'Nama Sales', T1.
WhsCode as 'Kode Gudang'
FROM dbo.OINV T0 INNER JOIN dbo.INV1 T1 ON T0.DocEntry =T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OINM T3 ON T2.ItemCode = T3.ItemCode AND T3.TransType = '13' and T3.CreatedBy = T1.DocEntry AND T3.Warehouse = T1.WhsCode
INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod
INNER JOIN OSLP T5 ON T0.SlpCode = T5.SlpCode
WHERE T0.DocDate >=[%0\] and T0.DocDate <=[%1\] and T4.ItmsGrpNam =[%2\] and T1.WhsCode =[%3\]
Thanks,
Gordon -
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 -
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. -
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 -
Blank Lines at end of file when using Variable Substitution in File Adapter
Hi all,
I'm using variable substitution in a File Adapter, it's refers an element of message, like:
filename payload:MESSAGE_INTERFACE,1,FILENAME,1
The variable substitution is working right, but it's append a BLANK LINE at end of file.
Anyone knows how to solve this problem ?
Thanks in advance.Hi Regis,
I suppose you're using content conversion?
if so try adding
<b>endSeparator</b> = '0'
to your last element
this will delete the default line break at the end
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>
Maybe you are looking for
-
How can I clean all data in a database but keep all datafile still same nam
hi, How can I get a easy way to clean all data in a database but keep all datafiles still same name and location just like a new created database? dbca has two choice: create templet without datafile or with all datafiles but not empty datafiles. tha
-
Ipod Nano (7th gen) won't play in Prius
I have no problems with my ipod classic or with my husband's ipod classic (these use the old USB cords). But when I try my nano or iphone 5 (both use the newer cord that came with the nano), the connection doesn't work. When I connect it, I get the
-
I'm using LC Forms 6, and we have a form rendered in HTML. Once the form is submitted we want to be able to clear out the browser cache upon rendering the form in it's final format, which is a submitted successfully page. Is there a way to programati
-
when i connect my ipad using USB cable, its name is not showing in ITunes on the left handside. anyone could help resolve this problem?
-
PO output , address problem..?
Hi experts In my PO print the Pincode in flowing wrongly. Where i can correct this pincode ..? Please note it down, My company is ABCD , for X vendor i raised PO. The pincode is not flowing for ABCD company in PO print , where i can correct it ..????