How can i insert character data in a table using the report trigger

well here is my query
do_sql ('insert into report_trigger_details values(po report,before parameter)');
i need to to insert data from within the report using the before parameter form trigger.Error is as follows:
error: rep-1425,cant parse the statement,missing comma
This error got removed by removing the space in ''po report" and before parameter"
Now the error that i get is :ora-00984:column not allowed here
Also i need to keep the spaces between the values while inserting data
Please help!!!
Thanks
Edited by: 924271 on Mar 29, 2012 7:02 AM
Edited by: 924271 on Mar 29, 2012 7:07 AM
Edited by: 924271 on Mar 29, 2012 7:08 AM

I know this isnt a great way of using query but its part of the assignment ,so any help will be greatly appreciated.
Here it is again......
function BeforePForm return boolean is
segment2 varchar2(10);
begin
     srw.message(001,'I just got executed first');
srw.do_sql('select segment1 into :segment2 from xxmssl_po_headers_all');
srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'')');
srw.do_sql('commit');
return (TRUE);
end;
the that i was getting earlier was resolved by using two single quotes....Now the error is....
Error: error putting value in column....
column 'segment2' may not be referenced by parameter triggers..
The insert ran fine until I changed the above function as follows:
function BeforePForm return boolean is
segment2 varchar2(10);
type_code varchar2(10);
org_no number(4);
begin
     srw.message(001,'I just got executed first');
srw.do_sql('select segment1,type_lookup_code,org_id into :segment2,:type_code,:org_no from xxmssl_po_headers_all');
srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'':segment2 '',type_code is'':type_code '',org_no is'':org_no )');
srw.do_sql('commit');
return (TRUE);
end;
When i ran it ,it started giving the above mentioned error.I reverted the changes back and recompiled my report but still getting the same error....
Thanks in advance
Edited by: 924271 on Mar 29, 2012 11:59 PM
Edited by: 924271 on Mar 30, 2012 12:11 AM

Similar Messages

  • How do you insert new records into multiple tables using the same unique primary key?

    I’ve created a PHP site and MySQL server using a free app called XAMPP.  I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database.  Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables?  In the SQL database, I defined the first field as ID and set it as the primary key with auto update.  So, when you insert a new record, it creates a unique primary key for that record.  In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?

    No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
    http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
    And the other using a PHP function:
    http://us3.php.net/mysql_insert_id

  • How do I insert  input data into anoracle table using C#

    Hi guys,
    I am new in the .NET arena and I am using Visual Studio 2005 Pro edition.. For instance I have 2 forms one being the main form which calls another to to insert captured text onto a form with the idea of passing it into the oracle database. I am failing to do that using C#. Where am I going wrong? Part of the code when I use actual values, data is written but when I want to write from input text from the form I get an Oracle message ORA-00936. A global connection is established in the first form.
    Here is the successful code:
    Try
    MyCmd.CommandText="insert into station (stn_abb,stn_no,stn_name)"+
    "values('MUT','0480','MUTARE')";
    Int rowsUpdated = MyCmd.ExecuteNonQuery();
    If (rowsUpdated == 0)
    MessageBox.Show("RECORD NOT WRITTEN");
    Else
    MessageBox.Show("RECORD WRITTEN TO TABLE");
    Txn.Commit();
    Here is the UNSUCCESSFUL code:
    Try
    MyCmd.CommandText = "insert into station (stn_abb,stn_no,stn_name)" +
    "values(@txtStnAbb.Text,@txtStnNo.Text,@txtName.Text)";
    Int rowsUpdated = MyCmd.ExecuteNonQuery();
    If (rowsUpdated == 0)
    MessageBox.Show("RECORD NOT WRITTEN");
    Else
    MessageBox.Show("RECORD WRITTEN TO TABLE");
    Txn.Commit();
    Regards,
    Ray.

    Hi,
    I assume that in the second example your intent is to use bind variables, but I dont see where you're actually binding any variables. Also, "@" is sqlserver syntax, Oracle's syntax is ":".
    Here's a complete example, hope it helps.
    Cheers
    Greg
    create table smallcol(col1 varchar2(5));
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class odpparams
         public static void Main()
              OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
              con.Open();
              OracleCommand cmd = new OracleCommand("insert into testtab values(:1)",con);
    cmd.Parameters.Add(new OracleParameter("1",OracleDbType.Varchar2,4,"fred",ParameterDirection.Input));
    cmd.ExecuteNonQuery();
    Console.WriteLine("done, no errors");
    con.Dispose();
    }

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

  • How can I set up an older airport express using the newest airport utilities?

    How can I set up an older airport express using the newest airport utilities? Seems like there isn't an option to set this up.  Normally you could add/set up this in the airport setup assistant- but that doesn't exsist any longer.
    Thanks for any suggestions 

    How can I set up an older airport express using the newest airport utilities?
    Unfortunately you can't, since Apple dropped support of the older AirPorts with AirPort Utility 6.x.
    Using some workarounds....not supported by Apple.....you might be able to download and install an older version of AirPort Utility that would allow you to administer the older AirPort.
    See this thread for more details and instructions:
    https://discussions.apple.com/message/21397085#21397085

  • I bought a used iPhone and found him email iCloud does not affect me so how can I deleted this email in order to use the device freely and privacy

    I bought a used iPhone and found him email iCloud does not affect me so how can I deleted this email in order to use the device freely and privacy
    help me please

    You can't. Return the phone for a refund, if you can, because without the previous owner's Apple ID/Password, you will not be able to re-activate the phone. It will be useless to you.
    Apple can't/won't help you with this.

  • I live in Afghanistan how can I have a free Apple ID to use the free app

    I live in Afghanistan how can I have a free Apple ID to use the free app

    Try to go into the App Store and try to download an app. When you have the option to sign in or create an Apple ID, choose to create one and you should see a 'none' option under payment.

  • How can I Insert a BLOB into a Table from Java?

    I have a Java class that creates an xml file from data in a non-sql data source. After it successfully creates and saves the file it inserts a record into an Oracle table to log the fact that an xml file was created.
    Now the guy in the warehouse wants to get an email with the file attached. I have been looking into the apex_mail package, because we already have a procedure using htmldb_mail. However, that procedure is on our old server with HTMLDB 1.6 and it is not sending any attachments.
    I think I have most of the apex_mail worked out, but I'm stuck on the blob thing. This is what I have so far:
    * The Java program creates a String object called xmlDoc
    * After xmlDoc is fully constructed, the file is written to the (Linux) server. This is accomplished with the following:
    // writing the xmlDoc
    fileDest = "/home/ewh/XMLOUT/";
    fileName = "OrderEW_"\+orderNbr\+"_"\+ticketNbr\+".xml";
    FileWriter fstream = new FileWriter(fileDest+fileName);
    BufferedWriter out = new BufferedWriter(fstream);
    out.write(xmlDoc);
    out.close();
    * Next I insert a record into the log file with:
    // Add a record to the Oracle order_email table to let the mail process know that
    // a new xml file is ready to be e-mailed to operations.
    emailLogInsertQuery = " insert into ewh.order_email ( file_name, create_date ) ";
    emailLogInsertQuery += " values ('"\+fileName\+"', sysdate)";
    oraAction = oraStmt.executeUpdate( emailLogInsertQuery );
    All of this is working fine so far. Now, I have added a blob type field to the order_email table, but I have no idea what to stick in there so that I have everything that apex_mail.add_attachment needs.
    Here's a description of the order_email table:
    SQL> desc ewh.order_email;
    Name Type Nullable Default Comments
    FILE_NAME VARCHAR2(30) Y
    FILE_BLOB BLOB Y
    CREATE_DATE DATE Y
    SEND_DATE DATE Y
    Thanks ever so much,
    Gregory
    Edited by: Canis Polaris on Jun 10, 2009 2:10 PM - Added escapes as necessary to show the plus signs around Java variables.

    Hi,
    From within APEX one can enter blob data in database tables, view the data and also update the data. Also one can send a blob attachment in an email.
    May be you can follow a combination of the following OBEs to insert BLOB data and send BLOB data from APEX:
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31email.htm
    -Priyanka

  • How can i delete app data on iPhone without uninstalling the app?

    How can i delete app data on iPhone 4 without removing the application.     Facebook application size -57mb. And its app data is 70mb  

    This is ridiculous!
    Imagine this scenario, can't be that unlikely:
    I'm going away on holiday, or away on work for a while, and I'm not taking the computer to which I sync my phone. Before I leave I fill my iPhone up with music to take with me. While I'm travelling I want to install a new app, but I don't have space. I look to delete content from the phone - I can delete podcasts but not music. Unfortunately I don't have enough podcasts to free up space that way. So I don't purchase the app I wanted.
    This is bad for:
    1. The user (me)
    2. The app developer - lost download.
    3. Apple - they lose their cut of the app download, and royally p#@* off a user.
    Can someone explain to me why this limitation is good for anyone?!

  • HT201205 How can I connect to a bluetooth devise and use the head phones at the same time? I have a new  ipod Touch  (32GB)'and want to play through a stereo system using the headphone jack and connect to a blue tooth speaker in another room

    How can I

    Not possible, there is a physical switch inside the headphone port, when the headphone jack is plugged in the switch is open and disables the iPod speaker and Bluetooth networks. Cheers.

  • Why can't I print to a Zebra 2746e using the report tool kit?

    I have read on here how peoople have printed barcodes from LV by sending commands directly to a zebra printer. I am using LV8.2.1 on a windows xp computer. I am sending EPL2 messages to the printer using the report tool kit, but all I get is a couple of line feeds. If I send the commands from a command prompt by coping a test file to the printer port it prints fine. Any thoughts. I have attached my program.
    Attachments:
    zebra tester.vi ‏22 KB

    I tried your code against my printer and it works as advertised. Can you print to other printers with it?
    By the way, when assembling a string you should use the Format Into String function instead of a string concatenator with a bunch of inputs. It takes up less room and is easier to interpret when troubleshooting.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How can I insert OLE (data) programatically ?

    I need insert many (more than 10.000) OLE (pdf) file into BLOB field. I have tried using a program with DBMS_LOB.LOADFROMFILE procedure.
    So pdf file are in the Data Base, but those field (data) are not Ole data.
    If I compare the data in the DB field after insert with form (manually), it is bigger than the I get using my program. Forms insert add some data at the begin and the end, and also change some data in the middle (i have check hex data in both cases).

    hi carlos,
    proceed like this.
    1.
    SELECT empfb xblnr bldat dmbtr sknto qbshh zlsch laufd
                    laufi zbukr vblnr lifnr sknto belnr  kunnr blart
    FROM regup INTO CORRESPONDING FIELDS OF TABLE t_regup
    WHERE laufd EQ p_laufd
    AND laufi EQ p_laufi
    AND bukrs EQ p_absbu
    AND xvorl <> 'X'.
    Sort t_regup (by field)
    Delete adjacent duplicates from t_regup comparing (field)
    *Now ir t_regup has content .
    2.
    If not t_regup is initial.
    SELECT LAUFD LAUFI ZBUKR HBKID WAERS ZALDT
    HKTID LIFNR VBLNR CHECT ZLAND RZAWE
    UZAWE voidr
    FROM payr INTO CORRESPONDING FIELDS OF table t_payr
    For all entries in t_regup
    WHERE laufd EQ t_regup-laufd
    AND laufi EQ t_regup-laufi
    AND zbukr wa_regup-zbukr.
    Endif.
    3. now u got the entries in t_payr.
    4.
    Now since u want the colleted items of t_payr
      Declare the fields that u want move into t-Regup say (HBKID WAERS ZALDT
    HKTID LIFNR) as these are not three in t_regup.
    Loop at t_payr.
        Loop at t_regup.
    Read table t_payr with key  t_payr-f1   = t_regup-f1
                                 t_payr-f2   = t_regup-f2
                                 t_payr-f3   = t_regup-f3
    If sy-subrc = 0.
    T_regup-hbkid  =  t_payr-hbkid
    T_regup-waers  =  t_payr-waers
    T_regup-lifnr  =   t_payr-lifnr.
    Modify t_regup index sy-tabix.
    Endif.       
    Endloop
    Endloop.
    This will insert the entries of t_payr into t_regup.
    Hope this logic helps u out.
    regards,
    vijay.

  • How can I wait till data is loaded and get the latest entities in HTML CLient

    This is my first try using a JavaScript component. I found a nice timeline-Scheduler on github:
    Timeline Javascript Scheduler
    I made an nearly empt new Screen and I am using LS only to get the data and to switch to the next date.
    This works fine for the first date I set in the created.
    But if I change to the next day, there are still the just loaded records. When I switch again to the following date I get the records from the day before...
    myapp.dispo.divcontainer_render = function (element, contentItem) {
    // We need this div for the timeline
    $(element).append('<div class="calendar"></div><div class="realtime-info"></div>');
    //Bind to the date
    contentItem.dataBind("screen.suchDispodat", function (value) {
    var querydat = value;
    var items = [];
    var sections = [];
    //The querydat is set to the right date but the records I get are from the last executed query.
    contentItem.screen.getQuerydispobydatfahrerorderfahrer(querydat).then(function (result) {
    var dispos = result.data;
    dispos.forEach(function (dispo) {
    How can I bind the refresh to something like data loaded?
    Helmut

    From:
    http://blogs.msdn.com/b/lightswitch/archive/2012/12/19/enhancing-lightswitch-controls-with-jquery-mobile-michael-zlatkovsky.aspx
    "You could use setTimeout (which is sometimes necessary – see Joe’s Custom Controls post
    for an example)"
    Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
    http://LightSwitchHelpWebsite.com

  • How can I save captured clips to hard disk using the actual video recorded date, not the date I transferred it?

    When using Batch capture in AP5.5, the clips are saved to hard disk using the capture date as the Created Date and Modified Date.  How do I configure Premier to use the actual clips recorded date (Meta Data Basic/Date Created) so that I can view them in Windows folders and other applications based on the date the video was recorded, not when I imported it.

    AFAIK, there's no way to do that with Premiere Pro.  You can probably find a utility on the Internet that will change the dates for you after the fact. 
    Cheers,
    Jeff

  • How can I insert one row in ADF Table in JDeveloper 10.1.3

    Hi all,
    How can I add new row ADF Table in JDeveloper 10.1.3
    NOTE : I tried using create button still not working
    thanks

    If you are using ADF BC - try replacing the binding of the operation from Create to CreateInsert.
    See Re: A simple JSF Table CRUD - How To

Maybe you are looking for