Question with variable syntax

Ok
I run this;
select name
from shuttle_demo_category where id = 30;
It returns this:
name
ITEM 10
I am making this stored procedure:
create or replace
PROCEDURE loadname AS
BEGIN
declare
f utl_file.file_type;
V_dir varchar2(10);
cursor c_item is
select name
from shuttle_demo_category where id = 30;
r_item c_item%ROWTYPE;
begin
----grant execute on utl_file to public; This must be done first
---USER_DIR is the oracle dir
--- in this case USER_DIR is really c:\temp
V_dir := 'USER_DIR';
f := utl_file.fopen(V_dir, 'thing2.xml', 'w');
utl_file.put_line(f, '<?xml version="1.0" ' ||r_item.name || 'encoding="utf-8"?>');
utl_file.put_line(f, '<outline xmlns="http://xmlns.oracle.com/oxp/book/">');
utl_file.put_line(f, '<!--');
utl_file.put_line(f, 'The title-page element should point to a PDF title page inserted');
utl_file.put_line(f, 'at the beginning of the book. (OPTIONAL)');
utl_file.put_line(f, '<!-- So here is the title page reference, in this case it is going to use an RTF template -->');
utl_file.put_line(f, '<title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>');
utl_file.put_line(f, ' <!-- next follow all documents we want to combine -->');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage1.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, ' </item>');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage2.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, ' </item>');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage3.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, '</item>');
utl_file.put_line(f, '</outline>');
utl_file.fclose(f);
end;
END loadname;
It returns this in the file:
<?xml version="1.0" encoding="utf-8"?>
<outline xmlns="http://xmlns.oracle.com/oxp/book/">
<!--
The title-page element should point to a PDF title page inserted
at the beginning of the book. (OPTIONAL)
<!-- So here is the title page reference, in this case it is going to use an RTF template -->
<title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>
<!-- next follow all documents we want to combine -->
<item>
<content-container>
<content>c:\temp\mypage1.pdf</content>
</content-container>
</item>
<item>
<content-container>
<content>c:\temp\mypage2.pdf</content>
</content-container>
</item>
<item>
<content-container>
<content>c:\temp\mypage3.pdf</content>
</content-container>
</item>
</outline>
It did not insert the variable.... why???
Thanks for your help,
Doug

I tryed this:
create or replace
PROCEDURE loadname AS
BEGIN
declare
f utl_file.file_type;
V_dir varchar2(10);
cursor c_item is
select name
from shuttle_demo_category where id = 30;
r_item c_item%ROWTYPE;
begin
----grant execute on utl_file to public; This must be done first
---USER_DIR is the oracle dir
--- in this case USER_DIR is really c:\temp
fetch c_item into r_item;
V_dir := 'USER_DIR';
f := utl_file.fopen(V_dir, 'thing2.xml', 'w');
utl_file.put_line(f, '<?xml version="1.0" ' ||r_item.name || 'encoding="utf-8"?>');
utl_file.put_line(f, '<outline xmlns="http://xmlns.oracle.com/oxp/book/">');
utl_file.put_line(f, '<!--');
utl_file.put_line(f, 'The title-page element should point to a PDF title page inserted');
utl_file.put_line(f, 'at the beginning of the book. (OPTIONAL)');
utl_file.put_line(f, '<!-- So here is the title page reference, in this case it is going to use an RTF template -->');
utl_file.put_line(f, '<title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>');
utl_file.put_line(f, ' <!-- next follow all documents we want to combine -->');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage1.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, ' </item>');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage2.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, ' </item>');
utl_file.put_line(f, '<item>');
utl_file.put_line(f, ' <content-container>');
utl_file.put_line(f, ' <content>c:\temp\mypage3.pdf</content>');
utl_file.put_line(f, ' </content-container>');
utl_file.put_line(f, '</item>');
utl_file.put_line(f, '</outline>');
utl_file.fclose(f);
close r_item;
end;
END loadname;
but got:
Connecting to the database caprs.
ORA-01001: invalid cursor
ORA-06512: at "CAPRS.LOADNAME", line 18
ORA-06512: at line 2
Process exited.
Disconnecting from the database caprs.

Similar Messages

  • Select SQL statement with variable syntax error

    Hi All,
    I am running a Web Application with a java bean to connect to a mysql database. i have compiled a test .java file whcih works using the same statement that has a problem in my web application. Taking the statement out of the Web App makes it work so it must be this stetment:
    String SQLStatement = "SELECT * FROM MASTER WHERE USERNAME LIKE '"+data+"' ";
    This works fine in testing a separate java file, but it does not compile when running ant build to compile the same line of code for my Web App.
    I have tried many possibilities of changing the syntax to no avail, its a puzzle!
    Many thanks for any swift reply.
    ChrisG

    prepare:
    copy:
    build:
    [javac] Compiling 1 source file to C:\jwsdp-1.3\garland\build\WEB-INF\classe
    s
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:20: cannot resolve symbol
    [javac] symbol : variable data
    [javac] location: class logonApp.LogonBean
    [javac] String SQLState2 = "SELECT PASSWORD FROM MASTER WHERE PASSWORD L
    IKE '"+data+"' ";
    [javac]
    ^
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:79: cannot resolve symbol
    [javac] symbol : variable SQLState1
    [javac] location: class logonApp.LogonBean
    [javac] rs = stmt.executeQuery(SQLState1);
    [javac] ^
    [javac] 2 errors
    Thats the compiler error, but it still works on a normal java file. ill try a prepared statement in the mean time.
    ChrisG

  • Scalar Variable Syntax questions

    I am practicing Scalar  Variables in a workbook.  Can some help me answer these questions working with Variables.   The Table name is Flights.
    Create and set a Variable equal to the number of Flights that were late.
    Multiply that amount by the amount lost per late flight ($1,029) and store the amount in another variable.
    Take the total amount lost (#4) and subtract it from Total profit ($45,000) and store that number in a variable.
    Find out the Earliest FlightDate and add 10 years to it and store it in a variable.
    Find out the day of the week for the Latest FlightDate and store it in a variable.

    I'm not really sure how you would benefit from we giving the answers to your exercises. How would you learn from that?
    I will only point what I think is a misunderstanding. When they say Create and set a Variable equal to the number of Flights that were late., I think they mean a scalar variable, not a table variable.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Problem with variables in formulas when using CrystalReportViewer

    Post Author: Aksu
    CA Forum: Formula
    Hi! I have a problem with variables in Crystal Reports formulas, when using CrystalDecisions.Windows.Forms.CrystalReportViewer class from VS2005-project. ReportViewer always gives error:*************Crystal Report Windows Forms ViewerThis field name is not known.Details: errorKindError in File C:\{dir&#93;}\{file}.rpt:Error in formula <mCustomerAttributes>.'Dim result As String'This field name is not known.Details: errorKind ************* Report without variables works fine with Viewer and in Crystal Reports Designer report with variables works also fine. I have tried with both "formula-syntaxes" - basic and crystal. But Viewer always gives error when trying to define new variable.I think the problem might be with CR -versions, because VS-project has formerly been designed to VS2003 and CR9 or 10. Now I'm using VS2005 and CR11. Though I have changed all references to new CrystalDecisions-asseblies (Ver.11.0.3300.0), when I debug the project and checkout the Viewers ReportSources FormatEngine Shows version CR9_2.... I have no idea where it gets this version...***************DEBUG-view when Viewer is created *******************CrystalReportViewer    |_        ReportSourceClassFactoryName ... , Version=11.0.3300.0 , ...    |_            ReportSource            |_                FormatEngine    {CrystalDecisions.CrystalReports.Engine.FormatEngine}                        |_                        ClientVersionHeader    {CrystalDecisions.Shared.ReportServiceVersionHeader}                            |_                            |    version = 920     (int)                            |_                                Static members                                            |_                                        VER_CR9    = 920    (int)**************************************** Could anyone have any answers or tips for this problem? I'd really appreciate it... ---Aksu

    Has anyone been able to answer this question?
    I am having the same problem:
    I am designing a report in Crystal Reports XI Developer that contains parameters, which are passed to a stored procedure and are also used within formulas ( in Crystal Syntax ie. {?FORMAT_ID} ) in the report itself.
    I can run the report successfully in CRXI Developer.  The formulas use the correct values from the parameters entered during execution and everything looks good.
    I then deploy the report to Business Objects Enterprise XI.  I do all of the things necessary to manage the report including setting up the proper database connection information and default parameter values.
    When I run the report using the Crystal Report Viewer, I get the following error message:
    Error in File Forecasting.rpt:
    Error in formula <Report Format>.
    'if (not isNull({?FORMAT_ID} ) ) then
    This field name is not known.
    Details: errorKind
    This happens when I press the "Preview" button in the Manage Object dialog from Crystal or when I run the report using InfoView.
    I have changed the formulas and it doesn't seem to matter what the specific content of the formula is; other than the existence of a parameter reference in the formula.  If I comment out the parameter and replace it with a hard-coded value, it gets through the formula fine.
    Does Business Objects Enterprise XI support crystal reports with parameter references in the formulas?
    Thanks,
    Tim H.
    Edited by: Tim Haley on Nov 25, 2008 11:11 PM
    Edited by: Tim Haley on Nov 25, 2008 11:12 PM

  • Error in Looping with variable

    Dear All,
    Please help me. i want to loop of record. i have two scheme. First, i make without variable and not error. Second, i make with variable and error occurs. as below my syntax:
    First:
    declare
    x varchar(50);
    begin
    --x:='select dummy from dual';
    for c1 in (select dummy from dual) loop
    dbms_output.put_line(c1.dummy);
    end loop;
    end;
    result:
    X
    Second:
    declare
    x varchar(50);
    begin
    x:='select dummy from dual';
    for c1 in (x) loop
    dbms_output.put_line(c1.dummy);
    end loop;
    end;
    result:
    Encountered the symbol 'LOOP' when expecting one...

    Billy  Verreynne  wrote:
    Why? For what purpose?
    A cursor fetch loop is not the ideal processing structure.
    It is slow. It requires data to travel from the buffer cache of the database into PL/SQL variables (in the PGA). It requires context switching between the PL/SQL and SQL engines.
    It does not scale. More rows means more data to travel that path from the SQL engine to the PL/SQL engine. More loop iterations in PL/SQL. If a single loop iteration (for processing a row) is 1ms, then a 100,000 rows will take a 100 seconds. 200,000 rows 200 seconds. Etc. This clearly does not scale with an increase in data volume.
    Also keep in mind that DBMS_OUTPUT does not write to screen or display anything. It is incapable of accessing a client device as it executes inside a server process. So each call to DBMS_OUTPUT stores that line of text in very expensive server memory. When the database call is done, the client (e.g. TOAD or SQL*Plus) can read those lines from the database and the client can display it.
    So if your loop is for a 1000 rows, it means writing a 1000 lines of text into very expensive server memory - and then expecting the client to read that afterwards and display it. Why? This is not a standard client-server method. It also does not scale. It can actually crash the server when this method is abused.
    The standard method would be to create a SQL cursor using PL/SQL code, and then return a reference handle (pointer) to the client. This allows the client the ability to fetch data directly from the cursor - in an optimal way that does not consume expensive server memory.I have to say it: I sincerely appreciate you taking the time to write this whenever it needs to be written rather than just giving up and letting people stumble along with bad design - it must take a lot of mental stamina to keep doing it. One day it will sink into my head also :-)

  • Problem with variable substitution.

    Hello,
    I asked this before but now I want to change the question focus.
    I have scenario from IDOC to XML file.
    The scenario is digital invoice for our company in Mexico and I end this scenario with java mapping that I import from SAP marketplace.
    Now I have request to add to the XML file name the content of the field "<ODN_NUMBER>" from the XML data.
    I try to use with variables substitution.
    My payload is:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ZINVOIC02>
    - <IDOC BEGIN="1">
    - <EDI_DC40 SEGMENT="1">
    <TABNAM>EDI_DC40</TABNAM>
    <MANDT>400</MANDT>
    <DOCNUM>0000000006599015</DOCNUM>
    <DOCREL>700</DOCREL>
    <STATUS>30</STATUS>
    <DIRECT>1</DIRECT>
    <OUTMOD>2</OUTMOD>
    <IDOCTYP>INVOIC02</IDOCTYP>
    <CIMTYP>ZINVOIC02</CIMTYP>
    <MESTYP>INVOIC</MESTYP>
    <STDMES>ZEDI</STDMES>
    <SNDPOR>SAPDEV</SNDPOR>
    <SNDPRT>LS</SNDPRT>
    <SNDPRN>DEV400ECC</SNDPRN>
    <RCVPOR>SAPDEV</RCVPOR>
    <RCVPRT>LS</RCVPRT>
    <RCVPFC>LS</RCVPFC>
    <RCVPRN>MX_INV</RCVPRN>
    <CREDAT>20100118</CREDAT>
    <CRETIM>075931</CRETIM>
    <SERIAL>20100118075931</SERIAL>
    </EDI_DC40>
    - <E1EDK01 SEGMENT="1">
    <CURCY>USD</CURCY>
    <HWAER>MXN</HWAER>
    <WKURS>10.55530</WKURS>
    <ZTERM>0090</ZTERM>
    <KUNDEUINR>ACH971209KRA</KUNDEUINR>
    <BSART>INVO</BSART>
    <BELNR>0100017295</BELNR>
    <BRGEW>0.045</BRGEW>
    <GEWEI>KGM</GEWEI>
    <FKART_RL>LR</FKART_RL>
    <RECIPNT_NO>0000012977</RECIPNT_NO>
    <FKTYP>L</FKTYP>
    - <Z1EDK01 SEGMENT="1">
    <XML_VERSION>2.0</XML_VERSION>
    <ODN_PREFIX>A</ODN_PREFIX>
    <ODN_NUMBER>1883</ODN_NUMBER>
    <DATE_TIME>2009-11-01T17:05:10</DATE_TIME>
    <DOC_SUB_TOTAL>4.22</DOC_SUB_TOTAL>
    <DOC_DISCOUNT>3.00</DOC_DISCOUNT>
    <DOC_TOTAL>1.40</DOC_TOTAL>
    </Z1EDK01>
    And the xml that I create is:
      <?xml version="1.0" encoding="utf-8" ?>
    - <Comprobante xmlns="http://www.sat.gob.mx/cfd/2" version="2.0" serie="A" folio="1883" fecha="2009-11-01T17:05:10" sello="NxZCWU8hMJMiEc2fSZafpS81Z9rUScbBotvJ8lcW76GGpmcD2lFyAV7DlNQKecYMnQJnwMVoHfGjzhpFJrjLuRcyqU3nOnH1mE1JMxY/MjLkal0Ybo2aRKCorQxx+F/Vy5ucvyeDDFAt2gx0PeHJhFS3tJ6ssc6nryz3iUr8c=" noAprobacion="49806" anoAprobacion="2009" formaDePago="Pago en una sola exhibiciףn" noCertificado="00001000000100891274" condicionesDePago="90 DAYS FROM BILL OF LADING" subTotal="4.22" descuento="3.00" motivoDescuento="Customer DiscountCustomer Discount" total="1.40" tipoDeComprobante="ingreso">
    - <Emisor rfc="NMS940324RY6" nombre="Netafim Mexico S.A. de C.">
      <DomicilioFiscal calle="Leibnitz" noExterior="20" noInterior="901" colonia="Anzures" localidad="Mexico city" municipio="Miguel Hidalgo" estado="Distrito Federal" pais="Mexico" codigoPostal="11590" />
      </Emisor>
    - <Receptor rfc="ACH971209KRA" nombre="AGRICOLA 5 HERMANOS SA DE CV">
      <Domicilio calle="JUAN DE LA BARRERA NO 1249 NORTE" localidad="COL. CHAPULTEPEC" municipio="CULIACAN" estado="Sinaloa" pais="Mexico" codigoPostal="80040" />
      </Receptor>
    -     <Conceptos>
    I try to use with this variable:
    payload:ZINVOIC02,1,IDOC,1,E1EDK01,1,Z1EDK01,1,ODN_NUMBER,1
    I received in RWB the error:
    Attempt to process file 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: var_filename
    Thank you in advance for your help
    Elad

    But my target is looks very strange:
      <?xml version="1.0" encoding="utf-8" ?>
    - <Comprobante xmlns="http://www.sat.gob.mx/cfd/2" version="2.0" serie="A" folio="1883" fecha="2009-11-01T17:05:10" sello="NxZCWU8hMJMiEc2fSZafpS81Z9rUScbBotvJ8lcW76GGpmcD2lFyAV7DlNQKecYMnQJnwMVoHfGjzhpFJrjLuRcyqU3nOnH1mE1JMxY/MjLkal0Ybo2aRKCorQxx+F/Vy5ucvyeDDFAt2gx0PeHJhFS3tJ6ssc6nryz3iUr8c=" noAprobacion="49806" anoAprobacion="2009" formaDePago="Pago en una sola exhibiciףn" noCertificado="00001000000100891274" condicionesDePago="90 DAYS FROM BILL OF LADING" subTotal="4.22" descuento="3.00" motivoDescuento="Customer DiscountCustomer Discount" total="1.40" tipoDeComprobante="ingreso">
    - <Emisor rfc="NMS940324RY6" nombre="Netafim Mexico S.A. de C.">
      <DomicilioFiscal calle="Leibnitz" noExterior="20" noInterior="901" colonia="Anzures" localidad="Mexico city" municipio="Miguel Hidalgo" estado="Distrito Federal" pais="Mexico" codigoPostal="11590" />
      </Emisor>
    - <Receptor rfc="ACH971209KRA" nombre="AGRICOLA 5 HERMANOS SA DE CV">
      <Domicilio calle="JUAN DE LA BARRERA NO 1249 NORTE" localidad="COL. CHAPULTEPEC" municipio="CULIACAN" estado="Sinaloa" pais="Mexico" codigoPostal="80040" />
      </Receptor>
    I need to add folio field
    Elad

  • Finite pulse-trai​n generation with variable time lapses with NiDAQmx

    Being a newby in Labview and NiDAQmx, I find it tedious to program the application I need to drive my experiment : I want to generate a finite pulse train, with variable delays between two consecutive pulses. These delays are known before the experiment starts, summurized in a table (element 0 decribes the time lapse between pulse 0 and 1, element 1 between pulse 1 and 2 ...). I would like to use NiDAQmx to program this. I had in mind the following scheme : two counters, first one counting time between pulses, the second one generating the pulse once "counter one" has finished his job. What I don't figure out is how to reprogram "counter one"'s register, without introducing unwanted delays in the time
    sequence of my finite pulse train. I am using a 6052E DAQ, and I want to generate delays in a same pulse train ranging from 1 microsecond up to 20 seconds.
    Thank you for ANY help :-)

    Hello !
    Well, I will try to be more precise while answering your questions. But first let me thank you very much for your help : your comments, questions and remarks are very helpful to help me shape my project, as you shed light on particular problems I strictly had no idea before !
    1) I can certainly get on well with digital output as my flash device is triggered by TTL signals.
    2) The lighting device is home-made, and I think it will be better for my needs to produce light throughout the duration of the input at the “on” level. In any case it will be driven by TTL-like signals. The intensity is manually set, so no analog control is required.
    3) I will use Labview to collect the experimental data. The signal will be sampled during the light pulse : the rising edge of the TTL-like output signal will trigger both the lighting device and the data acquisition, the latter being stopped on the falling edge. The light emitted by the lighting device is called a “probe” for the following reasons : the photons are absorbed by the photosynthetic sample and “immediately” re-emitted at a longer wavelength. A photodiode acts as a signal transducer, and I monitor the intensity of this fluorescence. Knowing precisely when light pulses occurred after the initial start excitation (which is also a brief pulse of light but of a much greater intensity than the “probe” light) and the intensity of light emitted during theses pulses, I can reconstruct the kinetic of fluorescence decay. This kinetic reflects the behaviour of my biological sample. Thus no continuous acquisition is required as between two light pulses there is nothing to monitor. And all the half-time reaction are timed relative to the same “start” excitation as they reflect a jump sequence of an electron extracted by the “start” excitation : first jumps are quick ones (half-time in the 10 �s range) and last jumps are slow ones (half-time in the 1 s range). With respect to these kinetics, I would like a 1 �s precision. If not achievable, I could skip the quickest jump (but it would be a pity) and focus on the second one which has a 10 ms half-time reaction and a 100 �s precision would then be enough. But as we say in French : “Qui peut le plus, peut le moins !” (roughly meaning that when you can achieve the best, you easily can do the least). This precision relates to the position of one flash with respect to the others. I don’t need to be very precise on the duration of each individual light pulse : a typical value is 100 �s duration, but I can get on well with 90 �s or 110 �s, my data being an average of the light intensity emitted during the light pulse). All I want to know precisely is when it is fired.
    4) Concerning the hardware, I already have a NI 6052E DAQ board, and unfortunately my laboratory cannot allow me to spend more money on this. I also have a fast acquisition board (IMTEC T3012) I intended to use to acquire my photodiode signal in place of the 6052E A/D converter. It has an old Labview driver, and I managed to upgrade it to suit my needs. It has an onboard segmented memory and can keep track precisely (it has a 60 MHz sample clock) of a trigger event. I am wondering if I can overcome the timing precision issue with this board, knowing that I strictly don’t care that flash n�1 is triggered at (t0 + 10 �s) or (t0 + 11 �s), provided that I know it, allowing me to place precisely my data point on the time scale. I can program the number of memory segments (i.e. the number of light pulses) and each one is filled with data coming from the photodiode upon receiving the rising edge triggering the light pulse. The precise date at which each triggered is received is stored in the board memory, allowing time reconstruction.
    I do hope this is much clearer than my previous attempts ! Believe me, it is quite hard to leave biology for a while and enter the cryptic world of data acquisition !
    Gritche

  • Problems in SQL transform with variable in statement

    Hi,
    I have an sql transform with a variable in the statement. It looks like this:
    SELECT * FROM I.X where I.X.CUSTOMERNUMBER IN ([$variable])
    I have a script running prior which sets the $variable = '\'366800\',\'000933\'';
    (the CUSTOMERNUMBER field is a string)
    The problem is when DI compiles the SQL with the variable value, it is replacing each single quote with two single quotes, and thus turning my list of values into a single string (as recognised by DB2).
    How can I work around this? The CUSTOMERNUMBER field is indexed and the table is very large, so I want to use a very efficient statement to retrieve the data. I'm inserting this data into a different database, so I can't use the sql() function to execute the query and insert the rows into a new table in the same database (don't have authority to do that).
    I also need the sql to be dynamic because the customer numbers required will change from time to time. They're listed in another database and I plan on writing a loop to set the $variable value to contain all values in the lookup table, but I can't use that in a join because its in a different database and would not be efficient.
    Does anyone have any ideas? I'm literally all out, have tried a wide range of things to no avail, and none of my colleagues can work it out either.
    Thanks very much,
    -Steve

    I assume the SQL Transform is used only because of that in-list, not for other reasons....
    In this book page here: https://boc.sdn.sap.com/node/20046 at the very bottom it isdescribed on how to use the pushdown_sql() function in a where clause to add *any* text of your choice into the select statement DI generates. In this example I used a "where exists" but you can easily change the text to
    where key=5 and       pushdown_sql('my_datastore', 'CUSTOMERNUMBER IN ([$variable])')    and gender='M'
    I used the key=5 and gender=M just to clarify the syntax (I hope).
    For the SQL Transform, I wonder if you need the [$variable] syntax as well....

  • How can I do a multiple record data merge, but specify that a specific text frame with variable data only merges on the first record?

    I'm doing a multiple record data merge, I have 2 frames both with variable data placed inside.
    I would like to specify that one of the text frames only merges once(first record) and the other frame multiple times for each record in the data file.
    Is it possible?
    I thought that perhaps if I place the text frame that must merge once on the master page, it would work.  But you are not allowed to place variable text on the master and on the document page.
    I'm going to try it through scripting next, but thought that perhaps there is an easier way that I'm not aware of.
    Thanks,
    Suzanne

    Suzanne,
    If you were trying to post a screen shot, you would need to return to the forum and post it using the "camera" icon at the top of the post editing windows.
    I use a plug-in from Em Software called InData. One of the benefits for what I do is there are no individual frames on a page to deal with post-merge. Individual frames are great for simple merges (address labels, post cards, etc.). But I typically do more other types of merges.
    That said, there is a drawback--one needs to come to an understanding of writing expressions that actually parse the incoming data. So in the spice price list example, that looks like:
    It's reasonably easy once one does it a few times. And it can be far more complicated. The above is from Em Software's samples that has been tweaked. The best thing I can recommend would be to download the trial and see for yourself. They are good at responding to specific questions if you get stumped.
    I imagine this all could be scripted somehow in ID. But I have no idea how and the plug-in just lets me keep working.
    Mike

  • Use plan from stored_outlines from query with different syntax?

    Hello,
    I'd like to know is there any ability to use via stored_outlines plan from query with different syntax?
    Database version - 11.1.06
    If yes, maybe you'll take a look at steps (based on Metalink 726802.1), what I tried to do to make it work (with no success):
    alter session set create_stored_outlines=good;
    run good query
    create private outline good from SYS_OUTLINE_0... -< GOOD
    alter session set create_stored_outlines=bad;
    run bad query
    create private outline good from SYS_OUTLINE_0... -< BAD
    update ol$ set sql_text, textlen, signature, hash_value, hash_value2 from BAD to GOOD records
    leave ol$hintcount for GOOD untouched
    delete ol$ where ol_name='BAD';
    delete ol$hints where ol_name='BAD';
    delete ol$nodes where ol_name='BAD';
    execute dbms_outln_edit.refresh_private_outline('GOOD');
    alter session set sql_trace=true;
    alter session set use_private_outlines=true;
    run bad query
    examine trace file and find that it use execution plan different from both bad and good queries
    PS: Originally bad query is posted already Re: Poor performance while join of 2 comprehensive large views and small table
    PPS: Also I review thread CBO not picking correct indexes or doing Full Scans
    Thanks,
    Sergiy
    Edited by: kiberpress on Sep 30, 2009 6:59 AM

    A query with different syntax would result in a different hash value.
    Stored outlines work based on hash value.
    Your question is probably answered now.
    Sybrand Bakker
    Senior Oracle DBA

  • Insert into with variables

    Hi!
    I've a procedure with a insert into phrase.
    For example:
    INSERT INTO type (NAME) values(A_CHA);
    type is not a table name it is a variable and name is not a column name it is also a variable.
    Can i make a insert into with variables?
    How is the right syntax?
    Thank's for help!
    Nicole

    Hi!
    I've found a way to do this:
    sql_statement:= 'INSERT INTO' || type_table || '('||NAME|| ',CABLE_NUM,FACILITY_NUM) values( '||A_CHA||','||CABLE_N||','||FAC_N||')';
    EXECUTE IMMEDIATE sql_statement;
    But when i execute my procedure i get the error:
    Keyword INTO is missing!
    Please help
    Nicole

  • AdvancedDataGrid with XMLListCollection Syntax

    Hello All,
    I'm more of an XSLT/XPath guy, and need help with the syntax
    for Flex(if that's the only thing I'm doing wrong!). I have an
    XMLListCollection named "mapData" with records from a web service.
    Each record looks like this:
    <java:Results xmlns:java="java:com.example.com">
    <java:AssociatedFileID>9999</java:AssociatedFileID>
    <java:AssociatedFileName>example.csv</java:AssociatedFileName>
    <java:DataBucketID>123</java:DataBucketID>
    <java:DataBucketName>EDashboard</java:DataBucketName>
    <java:Fields>
    <java:DataBucketFieldName>Business</java:DataBucketFieldName>
    <java:DataBucketFieldValue>Loans</java:DataBucketFieldValue>
    <java:DataBucketFieldID>4281</java:DataBucketFieldID>
    </java:Fields>
    <java:Fields>
    <java:DataBucketFieldName>Section</java:DataBucketFieldName>
    <java:DataBucketFieldValue>Europe</java:DataBucketFieldValue>
    <java:DataBucketFieldID>4394</java:DataBucketFieldID>
    </java:Fields>
    <java:LoadedDateTime>2008-03-19T10:57:21-04:00</java:LoadedDateTime>
    <java:Suppressed>No</java:Suppressed>
    <java:DataBucketContentID>170</java:DataBucketContentID>
    <java:Status>Active</java:Status>
    </java:Results>
    My AdvancedDataGrid is:
    <mx:AdvancedDataGrid x="10" y="10" id="MapDG"
    designViewDataType="flat" width="100%" height="100%"
    dataProvider="{mapData}" click="{editBtn.enabled=true;}"
    selectionMode="singleRow" change="{editBtn.enabled=true;}">
    <mx:columns>
    <mx:AdvancedDataGridColumn headerText="ID"
    dataField=""/>
    <mx:AdvancedDataGridColumn headerText="Business"
    dataField=""/>
    <mx:AdvancedDataGridColumn headerText="Section"
    dataField=""/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    Here's what I'm trying to do for each column:
    1 - *::Results.*::DataBucketContentID.text()
    //this is the record ID
    2. -
    *Results.*::Fields.(*::DataBucketFieldName.text()='Business').*DataBucketFieldValue.text( )
    //Gets the 'DataBucketFieldValue' for each 'Fields' that has
    a 'DataBucketFieldName' = Business
    3. -
    *Results.*::Fields.(*::DataBucketFieldName.text()='Section').*DataBucketFieldValue.text()
    //Gets the 'DataBucketFieldValue' for each 'Fields' that has
    a 'DataBucketFieldName' = Section
    What do I need to put in the columns' dataField for this to
    work?
    Thanks,
    Trav

    Thanks to Tracy and a little research, I have my data grid
    populating - I wanted to post an example that worked for me:
    If below is a variable with your web service result...
    private var personXML:XML=<persons>
    <person>
    <FirstName>Santa</FirstName>
    <Surname>Claus</Surname>
    <Age>1000</Age>
    </person>
    <person>
    <FirstName>Tooth</FirstName>
    <Surname>Fairy</Surname>
    <Age>250</Age>
    </person>
    <person>
    <FirstName>Travis</FirstName>
    <Surname>Allen</Surname>
    <Age>27</Age>
    </person>
    </persons>
    You can use a function, which you'll need to assign to a
    column. Here it is concating text in 2 elements but you can also
    use it for namespaced elements (e.g.
    item.*::NodeName1.*::NodeName2.text()).
    private function showFullName(item:Object,
    Column:DataGridColumn):String{
    var fullName:String = item.FirstName + " " + item.Surname;
    return fullName;
    The first column uses the function to populate the data in
    the column. It has to use labelFunction (vs. dataField). The 2nd
    uses the node name directly.
    <mx:DataGrid id="personDG"
    dataprovider="{personXML.person}">
    <mx:columns>
    <mx:DataGridColumn width="150" headerText="Full Name"
    labelFunction="showFullName"/>
    <mx:DataGridColumn width="150" dataField="Age"
    width="50"/>
    <!--the column without header text wil take the value of
    the element-->
    </mx:columns>
    </mx:DataGrid>
    Hope this helps anyone else!
    Trav

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Report Designer - Query with variable

    Hi!
    When testing the report designer, we have found an issue - it’s not possible to embedding queries with variables.
    We have found note https://websmp107.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=012006153200000232982006
    that suggest a solution to the issue.
    My question is simply, does anyone know if this is a temporary fix, or is this a constraint that is not planned to be fixed by SAP? The note is a bit ambiguous.
    BR
    bjørn

    Hello,
    Queries with variables are still in restrictions for Report Designer.
    You can use this work-arond creating Query View and fill up the variables. This allows you to define a Report in RD. Then, use Web Appication Designer to include your Report into Web Application and replace the Query View with your initial Query.
    For the integration do following:
    1. Create new Web Template in WAD
    2. Drag-and-drop Web Item "Report"
    3. Go to Property Window in WAD and search for "REPORT" (description Report Design) parameter in Web Items Parameters
    4. Use the button on the right side of the parameter to open Report Designer and choose your Report in it.
    5. You should see that new Data Provider was created in WAD -> Open it and set it to your initial Query.
    5. Save you Web Template and execute in the browser.
    Regards, Karol
    Development BI

  • Is it possible to pass a subquery with variable value ?

    Hi
    Is it possible to pass a subquery with variable as date ....which inturn is used to retrieve the value from the main query .
    For ex, this query is used to obtain the forecast details based on month and i need to obatain the month value from the sub query where the user need to select the forecast date as one of the  parameter
    select OFCT.Name,Fct1.ItemCode,sum(fct1.Quantity) as S_Qty,month(Fct1.date)as For_Month
    from Fct1,OFct
    where  Fct1.absid = ofct.absid
    and fct1.ItemCode = '26259939'
    and month(fct1.date) in (select month(fct1.date)from fct1 where fct1.date =<b> '[1%]'</b>)
    Hope somebody will respond
    Regards
    Mini

    Hi Owen,
    I have tried this query in Query Generator after trying it SQL Query Analyzer for syntax error as you had mentioned ,
    The query i have tried and is working with Analyser is :
    select OFCT.Name,Fct1.ItemCode,sum(fct1.Quantity) as S_Qty,month(Fct1.date)as For_Month
    from Fct1,OFct
    where  Fct1.absid = ofct.absid
    and FCT1.ItemCode = '4/4650017/2'
    and month(fct1.date) = '11'
    group by FCT1.itemcode,OFCT.NAme,FCT1.date
    In Query Generator when i try the same query,the Itemcode and Month need to be entered as variable, Iam able to take the item.Even the variable window shows me the Forecast date but the query throws an error 8180.
    Any help will be appreciated.
    Thank you
    Mini

Maybe you are looking for

  • I am trying to migrate my whole iTunes experience (music files, number of plays, Genius, playlists) from a windows pc to an iMac.

    I have copied everything from my external hard drive (which is where I told iTunes my library was) to my iMac. I am now viewing all my content BUT all the user experience is not there (playlists, number of plays, etc). Can you help? I also noticed th

  • Using OID Authorisation in APEX

    Hi, One of my colleagues (much more skilled in APEX than me) has written a package that makes it easy to use Oracle Internet Directory (OID) groups to control access to pages and items. It assumes that you are already using Oracle Single Sign-On (whi

  • Imac thunderbolt port not recognising hardware

    I recently purchased a late 2012 27' imac 3.4GHz, i7.  The things works beautifully, however I'm having a particular issue with the thunderbolt ports.  It's not recognising hardware I plug in - to either port.  I've done a fair bit of research - done

  • Python 2.7 on Oracle Linux 6.3

    Hi, Can someone help me to install Python 2.7 on Oracle Linux 6.3? Looking for installation steps for Oracle Linux 6.3 fresh image. Thanks,

  • Adobe flash crashes in gmail

    Using Gmail, I get a message saying Adobe Flash has crashed and prompting me to reload or report the problem. I didn't have this issue until I switched to the 4 Beta version of Firefox. Is there a flash upgrade I should apply?