Select result is cutted by 1

Hi Oraclecommunity,
i have a problem with col dimensions. i defined a col with nvarchar2(10), and put in a string that has 10 characters.
When i do a select statement on this col the result only exists of 9 characters. What is wrong? I use 11g R2 on Win7 64-bit, i checked my oracle installation, which is a 32-bit version.
I have this problem with all col's in my instance.
This problem doesn't appear in a 10g R2 database, with the exact same tables, definitions, etc...
greeting tobi

the version view gives me this:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE     11.2.0.1.0     Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
sorry, the oracle forum contains a LOT of topics, threads, .... i postet into the wrong okay .... can you move this thread into the right forum?

Similar Messages

  • How to show the SELECT result in a certain form?

    Hallo,
    I have the folling problem:
    CREATE TABLE buildings (
    building VARCHAR2(20) NOT NULL,
    city VARCHAR2(20) NOT NULL,
    no_of_buildings NUMBER NOT NULL);
    Now I make a SELECT * FROM buildings:
    building city no_of_buildings
    School Rome 20
    School Paris 30
    Cinema New York 15
    Theater London 10
    Theater Rome 7
    But I need the SELECT result in this form:
    Rome Paris New York London
    School 20 30 null null
    Cinema null null 15 null
    Theater 7 null null 10
    Is this possible?
    Thank you
    Werner

    Sorry,
    my request is not formatted well. I try again:
    Hallo,
    I have the folling problem:
    CREATE TABLE buildings (
         building          VARCHAR2(20) NOT NULL,
         city               VARCHAR2(20) NOT NULL,
         no_of_buildings     NUMBER NOT NULL);
    Now I make a SELECT * FROM buildings:
    building     city          no_of_buildings
    School      Rome                         20
    School      Paris                         30
    Cinema      New York                    15
    Theater      London                         10
    Theater      Rome                         7
    But I need the SELECT result in this form:
                   Rome     Paris     New York     London
    School          20          30          null          null
    Cinema          null     null     15               null
    Theater          7          null     null          10
    Is this possible?
    Thank you
    Werner

  • Sql (Select) result in string

    Hi , I found this code in internet but it´s put a result in range on excel. 
    I would like some code with end is some like  "MyVarString = objMySQLRecordsetResult"
    For example: In my select result = "User01" , I would like put this value in a var string.
    The code ends ...
            'ActiveSheet.Range("A1").CopyFromRecordset objMyRecordset
    I want ...
    Test01 = Recordset objMyRecordset
    tks for your help !!
    Public Sub GetDataFromADO()
        'Declare variables'
            Dim objMyConn As ADODB.Connection
            Dim objMyCmd As ADODB.Command
            Dim objMyRecordset As ADODB.Recordset
            Set objMyConn = New ADODB.Connection
            Set objMyCmd = New ADODB.Command
            Set objMyRecordset = New ADODB.Recordset
            Dim TESTE01 As String
        'Open Connection'
            objMyConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;Data Source="
    & ActiveWorkbook.Path & "\Database.accdb" & "; Jet OLEDB:Database Password= `MY PASSWORD"
            objMyConn.Open
        'Set and Excecute SQL Command'
            Set objMyCmd.ActiveConnection = objMyConn
            objMyCmd.CommandText = "select DUSER from DUSER WHERE DUSER = 'USUR01 "
            objMyCmd.CommandType = adCmdText
       'Open Recordset'
            Set objMyRecordset.Source = objMyCmd
            objMyRecordset.Open
            objMyRecordset.OpenRecordset
        'Copy Data to Excel'
            'ActiveSheet.Range("A1").CopyFromRecordset objMyRecordset
    End Sub

    Try:
    Public Sub GetDataFromADO()
    Dim Conn As New ADODB.Connection
    Dim Rs As New ADODB.Recordset
    'Open Connection'
    Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;Data Source=" & ActiveWorkbook.Path & "\Database.accdb" & "; Jet OLEDB:Database Password= `MY PASSWORD"
    Conn.Open
    'Open Recordset'
    Rs.Open "select DUSER from DUSER WHERE DUSER = 'USUR01'", Conn, adOpenDynamic, adLockReadOnly
    'Copy Data to Excel'
    ActiveSheet.Range("A1").CopyFromRecordset Rs
    Rs.Close
    Conn.Close
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Purchase Order restrict selection result

    Hi experts!
    We are on SRM5.0 in ECS.
    When a user search Purchase order in the 'Change Purchase Order' transaction BBP_POC he will be able to see all purchase orders within the company.
    Actually there is the possibility to restrict the selection results by purchasing organization or purchasing group, but this is not usefull for us. Is there any other object we can use?
    Many thanks for your help.
    Best regards,
    Corinne

    Hello,
    You could use the badi BBP_WF_LIST to filter this list at your convenience.
    You also could use structural authorization (tx OOSB, OOSP).
    Rgds,
    Pierre

  • select Tag Mozilla cuts off at 20 IE6 cuts off at 30 We are expecting 30 more lines in drop down list without scrollbar.

    <select> Tag Mozilla cuts off at 20 IE6 cuts off at 30 We are expecting 30 more lines in drop down list without scrollbar.

    it has been answered

  • Generate update statement from select results

    I'm trying to generate an update statement based off select statement results.  A very basic example,
    SELECT ListID FROM DListing WHERE Status = 2
    Results return 3 rows.
    1234
    2345
    3456
    How can I take those results and turn them into WHERE criteria for UPDATE statement?
    Generated UPDATE statement should look like this.
    UPDATE DListing SET Status = 1 WHERE ListID IN (1234,2345,3456)
    I have started by creating a temp table to hold my SELECT results, but I don't know how to get those results into format for IN condition.  Right now I get 3 UPDATE statements with 1 ListID in each IN condition.
    CREATE TABLE #TempStatusUpdate(ListID INT)
    INSERT INTO #TempStatusUpdate
    SELECT ListID FROM DListing WHERE Status = 2
    SELECT 'UPDATE DListing SET Status = 1 WHERE ListID IN (' + CONVERT(VARCHAR(30),ListID) + ') AND Status = 2'
    DROP TABLE #TempStatusUpdate

    So what wrong with
    UPDTATE DListing
    SET     Status = 1
    WHERE   ListID IN (SELECT ListID FROM #TempStatusUpdate)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Display User Selection Results on Cover Sheet of the Crystal Report

    How do you display the result of a multi-level dynamic parameter that the user has selected on the cover sheet of the crystal report.
    Or Display the Start & Ending selection results from a dynamic parameter on the cover sheet of the crystal report.

    Replace the code with:
    stringvar selection;
    stringVar array arr1;
    numberVar i;
    redim preserve arr1[count({?ProductID})];
    for i := 1 to count({?ProductID}) step 1 do
    arr1<i> := {?ProductID};
    selection:= 'ProductID is : ' & chr(39) & join(arr1,",") & chr(39);
    This should hopefully fix the error, but I don't think it will solve your problem as it might keep assigning the same product id to each element of the array.
    Have you tried just join({?parameter},', ') as suggested by RG?
    Edited by: Sanjay Kodidine on Jul 1, 2009 10:22 AM

  • Using selection tool to Cut image into pieces...

    Hi all,
    I was just experimenting with my Painter image editing software in my computer, and I just thought about an effect that I performed in my Painter software.
    Actually, what I did is best show in images attached here. Please use them as a guide to my questions.
    In Painter, I used the selection tool to seperate parts of my image as seen in my attached image. I just wonder whether one can do the same thing in after effects too.
    Thanks and hope to here your responses to my question.

    Ok. Thanks for your great tips as I'll see where I can go from here.
    Ugoharris.
    Date: Tue, 22 Dec 2009 09:46:28 -0700
    From: [email protected]
    To: [email protected]
    Subject: Using selection tool to Cut image into pieces...
    Like Steve said, you'll have to use masks. To keep it clean and predictable, draw all your masks as needed, then duplicate the layer (Ctrl+D). then delete the masks on a given layer that you don't need. What is to become the background with "holes" also will need the mask modes to be set from the default Add to Subtract. Once you have everything, you may wish to use the pan behind tool (Y) to move the layer anchor points into the centers of the masked shapes, so animation becomes a bit more predictable.
    Mylenium
    >

  • Including batchCharacteristics in'Selection Result forBatches' pane inBMBC

    1. I create batch Class CUT_IRON (class type 022)
    2. I create three characteristics (iron_colour, iron_width, & iron_alloy)  & assign these three characteristics to Class CUT_IRON.
    3. While creating batch managed material KR352NG, i assign Class CUT_IRON to this material in the Classification view.
    4. When doing Confirmation of Prod Order (co15) for this material, a batch number is generated & these Characteristics Values filled for each batch.
    5. In BMBC, how do I make settings so that for batches these Characteristics will be displayed in the ''Selection Result for Batches'' pane?

    Hello,
      from transaction BMBC select the menu path "Utilities --> User settings" . In the field "User group selection" choose the entry: "SAP 2 SAP example 2: classification".
    You can maintain these entries from customizing under "Logistics - General --> Batch Management --> Batch Information Cockpit --> Define User-Group-Specific Selection".
    Hope to be useful.
    Best regards,
    Andrea

  • Select into xmltype cuts tags

    Hello.
    My query:
    SELECT XMLELEMENT("Dataset", XMLATTRIBUTES('http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic' AS "xmlns:generic"),
    XMLAGG(XMLELEMENT("generic:Series",
    XMLELEMENT("generic:SeriesKey",
    XMLELEMENT("generic:Value", XMLATTRIBUTES(SPR_EMS1 as "concept", CODE_EMS1 as "value")),
    XMLELEMENT("generic:Value", XMLATTRIBUTES(SPR_EM2 as "concept", CODE_EMS2 as "value")),
    XMLELEMENT("generic:Value", XMLATTRIBUTES(SPR_EMIS3 as "concept", CODE_EMS3 as "value"))
    XMLELEMENT("generic:Attributes",
    XMLELEMENT("generic:Value", XMLATTRIBUTES(EDI AS "concept", EDI_NAME AS "value")),
    XMLELEMENT("generic:Value", XMLATTRIBUTES(NAME_PERIOD as "concept", TO_CHAR(MONTH_DATE, 'fmmonth') as "value"))
    XMLELEMENT("generic:Obs",
    XMLELEMENT("generic:Time", TO_CHAR(MONTH_DATE, 'YYYY')),
    XMLELEMENT("generic:ObsValue", XMLATTRIBUTES(NUM as "value"))
    INTO TAG
    FROM
    (SELECT MONTH_DATE, NAME_PERIOD, NUM, EDI, EDI_NAME, SPR_EMS1, CODE_EMS1, SPR_EMS2, CODE_EMS2, SPR_EMS3, CODE_EMS3
    FROM EMS_001
    WHERE (TO_CHAR(MONTH_DATE, 'YYYY') = OTCH_YEAR AND TO_CHAR(MONTH_DATE, 'MM') <= OTCH_MONTH) OR (TO_CHAR(MONTH_DATE, 'YYYY') = TO_CHAR(TO_NUMBER(OTCH_YEAR-1)))
    ORDER BY MONTH_DATE, SEQ_CODE1, SEQ_CODE2, SEQ_CODE3);
    It works good just for a certain number of returned rows. But when i select much more data from table this selection will be cut in any part of any tag.
    Am i right that XMLTYPE has max length? How can i increase it?
    Thank you.
    Edited by: Alexys on 17.04.2012 0:26

    when i select much more data from table this selection will be cut in any part of any tag.I also suspect it is a client issue:
    e.g. in sql*plus you would have to set an appropriate LONG value:
    SQL> set long 100
    SQL> select xmltype('<x>' || lpad('x', 200, 'x') || '</x>') xml from dual;
    XML
    <x>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    1 row selected.
    SQL> set long 250
    SQL> select xmltype('<x>' || lpad('x', 200, 'x') || '</x>') xml from dual;
    XML
    <x>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxx</x>
    1 row selected.
    SQL>

  • How can i get select result in varray

    Hi,
    I am new in oracle. I have the following sproc it return around 500 records but OCCI takes long time to get all records due to one-by-one records fetch.
    TYPE rec_type is record ( f1 integer, f2 integer, f3 integer,f4 integer );
    TYPE id_rec_type IS REF CURSOR RETURN rec_type;
    PROCEDURE get_s_data (
    v_s IN VARCHAR2,
    v_p IN INTEGER ,
    v_d IN INTEGER ,
    o_cd OUT NUMBER ,
    o_id OUT id_rec_type ) IS
    BEGIN
    DECLARE
    v_start_date DATE;
    BEGIN
    select get_start_date(TO_CHAR(SYSDATE,'DD-MON-YYYY') ,-1* v_d ) into v_start_date from dual;
    OPEN o_id FOR
    SELECT f1 , f2 , f3, f4
    FROM T1
    WHERE s1 = v_s
    AND timestamp >= v_start_date;
    END;
    I want to convert above sproc in VARRAY/Table to utilize bulk fetch
    I am not sure how to convert multicolumns select result in varray.
    example in document use only one column in varray from select statement.
    some exmple use cursor with bulk fetch but problem is cursor need to define in declare section.
    I have one condition in where clause and get calculate in sproc.
    any suggestion?

    thanks for reply.
    It doesn't work with ref cursor as output parameter in sproc.
    Please see my post in OCCI forums.
    Performance problem with sproc and out parameter ref cursor
    after spending some time found one way.
    prcedure p1 ( i1 IN integer , i2 IN integer, v1 OUT varray_type )
    declare
    cursor c1 is
    select c1 , c2 , c3 , c4
    from t1
    where c1 > i1 and c2 > i2;
    begin
    open c1;
    fetch c1 bulk collect into v1;
    close c1;
    end;
    procedure p2 ( v1 OUT varry_type )
    declare
    i1 integer
    i2 integer
    begin
    i1 := new_calculate_value(i2);
    i3 := calculate_s(i2);
    p1(i1,i3,v1);
    end;
    above method allow us to calculate where clause value before cursor define and get filter data.
    I am working OCCI to get varray from above method.

  • Table AGR_AGRS -  selection results not sufficient ??

    I want to select all customer activity groups (single roles) which are NOT included in a composite role.
    With the transaction SUIM I got the list of all used single activity groups.
    Then I put them in the selection criteria of table AGR_AGRS (SE16) as "child AGR".
    All (child) activity groups which are not in the result list are single, right?
    NO!!! I made I test with a huge composite activity group: Its children roles are not all listed! Some are, some are not.
    Can You explain, please?
    Thanks a lot!
    Birgitta
    Edited by: Birgitta Meier on Jul 28, 2008 12:12 PM

    > I want to select all customer activity groups (single roles) which are NOT included in a composite role.
    It's allways difficult to find things that are not there
    My suggestion is to do the following:
    1- Make a download from AGR_DEFINE containing all single roles you want to check and store it in a spreadsheet.
    2- Make a download from AGR_AGRS and store this in the same sheet.
    3- For each row in the first download, find out if it is in the CHILD_AGR column of the second one. In Excel the function VLOOKUP will be helpful.
    Hope this helps,
    Jurjen
    If you ever want to look for empty composites, those are the ones that appear in AGR_FLAGS with FLAG_TYPE "COLL_AGR" and FLAG_VALUE "X" but cannot be found in AGR_AGRS.
    Edited by: Jurjen Heeck on Jul 28, 2008 2:31 PM

  • Oracle 9i bad SELECT result?

    Hi people,
    Here is a doozy for everyone....
    Can someone please explain the following behaviour to me?
    I was trying to setup some test data for a unit test ( I wanted to select a random row from a data table ). Okedokey, off I went and constructed the data table with full precision timestamps for every hour in the current year. Now to construct some random time ranges, I want to select the results of a random row in that table. Ah ha! 9i's analytics to the rescue.
    DOH! It didn't work... without the counter-intuitive rownum restriction on dual it randomly returns no rows, multiple rows and more importanly rows that do NOT fulfil the criteria of b.n_row being equal to a.n_random_row. To get it to work I need to put the patently ridiculous ROWNUM = 1 against the DUAL inline view .... Any ideas what is going wrong?
    =============== SETUP =================
    create table tmp_timeline ( t_timestamp timestamp(9) with time zone );
    insert into tmp_timeline
    select to_timestamp_tz( '01-JAN-2002 00:00:00 +10:00', 'DD-MON-YYYY HH24:MI:SS TZH:TZM' ) + rownum / 24 t_timestamp
    from all_objects, all_objects
    where rownum < 8760;
    =============== SETUP ====================
    =============== ERRONEOUS? SQL =============
    select to_char( t_timestamp ) "timestamp",
    n_row,
    n_random_row
    from
    -- ( 8759 is the count(*) of rows in table tmp_timeline )
    select trunc( dbms_random.value( 1, 8759 ) ) n_random_row
    from dual
    -- where rownum = 1
    -- ???? Uncommenting the nonsense line above this one fixes!
    ) a
    inner join
    select tt.t_timestamp,
    row_number() over ( order by tt.t_timestamp ) n_row
    from tmp_timeline tt
    ) b
    on b.n_row = a.n_random_row
    =============== ERRONEOUS? SQL =============
    I was under the impression that DUAL is designed to return exactly ONE row. Is my understanding of INNER JOIN and DUAL somehow cockeyed or is there something weird going on with the function execution?
    Please shed some light on this if you have any ideas!
    Thanks,
    Lachlan Pitts
    [select * from v$version]
    Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
    PL/SQL Release 9.0.1.1.1 - Production
    CORE     9.0.1.1.1     Production
    TNS for 32-bit Windows: Version 9.0.1.1.0 - Production
    NLSRTL Version 9.0.1.1.1 - Production

    Partition Outer Joins is the feature of Oracle 10g not 9i
    i think u r confuse with Analytical Functions Partition by thing.... Analytical functions are available since 8i
    Syntax for 10g Partition by
    SELECT ...
    FROM ...
    PARTITION BY (expr [,expr ]... )
    RIGHT OUTER JOIN table_referenceBaig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Bound autosuggest only displays selective results?

    I've been stumped by this issue and hope someone here can point me in the right direction:
    I have a autosuggest field that is bound to a component. When I call the component directly, it works as intended... when I try and use the component through the binding, it doesn't give me the same results.
    Here's the autosuggest code:
    <cfform name="teamsform">
    Search for a team: <br>
    Use team name, team id or any part of a team member's name.<br>
    <cfinput autosuggest="cfc:/ofcomponents.teams.getteams({cfautosuggestvalue})" autosuggestminlength="2" type="text" name="userSearchTerm" size="50" typeahead="yes"><br>
    <input type="submit" value="Go">
    </cfform>
    Here's the CFC:
    <cfcomponent>
        <cffunction name="getTeams" access="remote" returntype="string">
                <cfargument name="usersearchterm" required="yes" type="string">
                    <cfquery name="getTeams" datasource="#REQUEST.dsn#">
                    SELECT t.team_name as name
                    FROM of_users u left outer join of_teams t on u.of_user_id = t.user_id
                    WHERE 0 = 0
                    <cfif arguments.usersearchterm neq "">
                    and (t.team_name like '%#arguments.usersearchterm#%'
                    or t.team_id like  '%#arguments.usersearchterm#%')
                    </cfif>
                    and u.user_type_id in (select user_type_id from of_user_types where user_type_description = 'team')
                    UNION
                    SELECT t.team_name as name
                    FROM of_users u, of_teams t, of_team_participants tp
                    WHERE u.of_user_id = tp.participant_id and t.of_team_id = tp.team_id
                    <cfif arguments.usersearchterm neq "">
                    and u.first_name like  '%#arguments.usersearchterm#%'
                    or u.last_name like  '%#arguments.usersearchterm#%'
                    </cfif>
                    and u.user_type_id = (select user_type_id from of_user_types where user_type_description = 'participant')
                    </cfquery>
                       <!---  <cfdump var="#getteams#">
                        <cfabort> --->
    <cfset returnlist = valuelist(getTeams.name)>
        <cfreturn returnlist>
    </cffunction>
    </cfcomponent>
    As mentioned, when I call the component directly, like this:
    <cfinvoke component="/ofComponents.teams" method="getTeams" returnvariable="varret">
       <cfinvokeargument name="usersearchterm" value="Logan">
       </cfinvoke>
       <cfdump var="#varret#">
    It gives me the correct results (i.e. the Team name)
    When I type the same term in the text field, I get no results. When I type in a team name, I only get a result when the team name starts with the search term I am typing. Any other search returns no results.
    Can anyone see if I am doing something wrong or is there something else going on that I am not aware of?
    Thanks!

    When I type the same term in the text field, I get no results. When I type in a team name, I only get a result when the team name starts with the search term I am typing. Any other search returns no results.
    That's pretty much what I expect to happen with autosuggest. You've set autosuggestminlength to 2, so Coldfusion will respond only after you type the second character. It will then show you  elements from the list -- if there are any -- whose first 2 characters match what you typed. If you want instant matching you should set autosuggestminlength to 1.

  • Unable to bind the select() result to datagrid here........in air+sql connection

    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import flash.data.SQLConnection;
    import flash.events.SQLErrorEvent;
    import flash.data.SQLStatement;
    import flash.events.SQLEvent;
    import flash.filesystem.File;
    public function init():void
    // creating a connection and the database
    var conn:SQLConnection = new SQLConnection();
    conn.addEventListener(SQLEvent.OPEN, openHandler);
    conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);
    var dbFile:File = File.applicationStorageDirectory.resolvePath("DBSample.db");
    conn.openAsync(dbFile);
    // putting the database creation into the open handler of conn object
    function openHandler(event:SQLEvent):void
        trace("the database was created successfully");
        var createStmt:SQLStatement = new SQLStatement();
        createStmt.sqlConnection = conn;
    var sql:String =
        "CREATE TABLE IF NOT EXISTS employees (" +
        "    firstName TEXT, " +
        "    lastName TEXT, " +
    createStmt.text = sql;
    createStmt.addEventListener(SQLEvent.RESULT, createResult);
    createStmt.addEventListener(SQLErrorEvent.ERROR, createError);
    createStmt.execute();
    function createResult(event:SQLEvent):void
        Alert.show("Table created");
    // table structure error handle
    function createError(event:SQLErrorEvent):void
        trace("Error message:", event.error.message);
        trace("Details:", event.error.details);
    // error handler for conn object
    function errorHandler(event:SQLErrorEvent):void
        trace("Error message:", event.error.message);
        trace("Details:", event.error.details);
    b2.addEventListener(MouseEvent.CLICK,select);
    // select function
    function select():void
    // select statement
    var selectStmt:SQLStatement = new SQLStatement();
    selectStmt.sqlConnection = conn;
    selectStmt.text = "SELECT firstName, lastName FROM employees";
    selectStmt.addEventListener(SQLEvent.RESULT, resultHandler);
    selectStmt.addEventListener(SQLErrorEvent.ERROR, errorHandler);
    selectStmt.execute();
    function resultHandler(event:SQLEvent):void
        var result:SQLResult = selectStmt.getResult();
        var numResults:int = result.data.length;
        for (var i:int = 0; i < numResults; i++)
            var row:Object = result.data[i];
            var output:String = "firstname: " + row.firstName;
            output += "; lastName: " + row.lastName;
            trace(output);
    b1.addEventListener(MouseEvent.CLICK,insert);
    // insert fuction
    function insert():void
    var insertStmt:SQLStatement = new SQLStatement();
    insertStmt.sqlConnection = conn;
    var sqls:String =
        "INSERT INTO employees  (firstName, lastName)  values(:firstName,:lastName)";
        //""   + "(firstName, lastName) " + "VALUES ('Bob', 'Smith')";
        insertStmt.parameters[":firstName"] = fname.text;
          insertStmt.parameters[":lastName"] = lname.text;
    insertStmt.text = sqls;
    insertStmt.addEventListener(SQLEvent.RESULT, insertResult);
    insertStmt.addEventListener(SQLErrorEvent.ERROR, insertError);
    insertStmt.execute();
    function insertResult(event:SQLEvent):void
        trace("INSERT statement succeeded");
        fname.text="";
        lname.text="";
    function insertError(event:SQLErrorEvent):void
        trace("Error message:", event.error.message);
        trace("Details:", event.error.details);
    ]]>
    </mx:Script>
    <mx:TextInput x="17" y="52" id="fname" />
    <mx:TextInput x="17" y="120" id="lname"/>
    <mx:DataGrid x="375" y="87" dataProvider="">
    <mx:columns>
    <mx:DataGridColumn headerText="fname" dataField="col1"/>
    <mx:DataGridColumn headerText="lname" dataField="col2"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Button x="58" y="207" id="b1" label="insert" />
    <mx:Button x="375" y="288" id="b2" label="select" />
    </mx:WindowedApplication>

    what about creating an ArrayCollection variable 
         [Bindable]
         private var myAC:ArrayCollection;
    then
    function resultHandler(event:SQLEvent):void
        var  result:SQLResult = selectStmt.getResult();
        myAC = ArrayCollection(result.data);
    and
    <mx:DataGrid dataProvider="{myAc}"/>

Maybe you are looking for