RecordSet GetArray()

I am a beginner with using java with databases, so help would be appreciated.
I am tring to convert one of my ResultSet columns into an String[] array, but I keep on recieving the following sql error: "Feature not implemented"
I am using a MySql database.
----------------My Code-------------------------------------------------
public void getAllItems(String itemList[])
String sql;
Statement st = null;
ResultSet rs = null;
if (this.OpenMyConnection() )
try
sql = "SELECT itemName FROM items";
st = this.getMyConnection().createStatement();
rs = st.executeQuery(sql);
itemList = (String[])rs.getArray(1).getArray(); //Error
System.out.print(itemList.length);
catch (SQLException sqlE)
System.out.println(sqlE.toString());
System.out.println(sqlE.getMessage());
finally
this.CloseMyConnection();
Thank you

I think the following piece of code is wrong
itemList = (String[])rs.getArray(1).getArray(); //ErrorIf this is
itemList = ((String[])rs.getArray(1)).getArray(); should work

Similar Messages

  • Recordset per message in Sender File Adapter

    Hi Friends
    I have configured a sender file adapter to pick up *.txt files from a specific path, Since the file is having thousands of records it is failing to process the file at  PI level . In order to avoid the problem I have kept Recordset Set Per Message as 10 , but still PI is processing all the records into a single message. Please help me in troubleshooting it.
    Regards
    Suman.

    Hi Suman,
      Go thru these threads for troubleshooting...
    Massive file
    Processing huge file loads through XI
    Processing of huge no of Inbound xml files
    Bottleneck in Large file processing
    How to process large data files in XI  ?  100 MB files ?
    Regds,
    Pinangshuk.

  • When I try to create a Recordset i get Javascript runtime error

    Please help i am working with Php and trying to create a
    recordset query to access my table etc. this is what i get when i
    click + Recordset from the Server Behaviors window:
    JavaScript error while loading RecordSet.htm:
    At line 1111 of file: "C:\Program
    Files\Macromedia\Dreamweaver
    8\Configuration\ServerBehaviors\PHP_MySQL\Recordset.js" : theStr =
    theStr.replace(/(?>)*/gi, ''''); //remove close tags
    SyntaxError: Invalid Quantifier ?

    i restarted it i am gonna restart the computer
    also went here
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19105&sliceId=1#dat
    didnt really help

  • Multiple tables in a recordset.

    Hi all,
    I have got a bit stuck with creating an advanced recordset that calls from multiple sub tables. I have created the SQL statement below (originally used inner joins but the code got too long and still didn't work).
    SELECT *
    FROM Main_Table, Table_1, Table_2, Table_3, Table_4, Table_5, Table_6, Table_7, Table_8, Table_9, Table_10, Table_11, Table_12, Table_13, Table_14, Table_15
    WHERE
    (((((((((((((((((Main_Table.ID_1 = Table_1.ID_1),
    Main_Table.ID_2 = Table_2.ID),
    Main_Table.ID_3 = Table_3.ID),
    Main_Table.ID_4 = Table_4.ID),
    Main_Table.ID_5 = Table_5.ID),
    Main_Table.ID_6 = Table_6.ID),
    Main_Table.ID_7 = Table_7.ID),
    Main_Table.ID_8 = Table_8.ID),
    Main_Table.ID_9 = Table_9.ID),
    Main_Table.ID_10 = Table_10.ID),
    Main_Table.ID_10 = Table_11.ID),
    Main_Table.ID_11 = Table_12.ID),
    Main_Table.ID_11 = Table_13.ID),
    Main_Table.ID_11 = Table_14.ID),
     Main_Table.ID_12 = Table_15.ID),
    AND cust_id = colname
    The idea is to get some text values from the sub tables by passing through the relevant ID of the main table to the sub tables ID. To add to the complexity the "cust_id = colname" is a passthrough from a prior page that only brings up a specific record from the main table. Further complexity may come where the two bolded sections are using a single ID from the main table to call from multiple sub tables.
    Ideally at the end of this I just want to pull the value from the recordset and drop into the page design. The page is PHP and the database/web server is using WAMP, if that helps?
    I feel i'm so close (but i'm probably nowhere near!). Can anyone help me before I lose my hair and develop a nervous tick? Unfortunately, I am still a bit of a novice with these things, so if it's my syntax or a coding issue please could you explain it in noob terms for me?
    Thank you in advance!

    The database was an access DB of 1 main table and 15 related tables that was then converted to MYSQL. The idea is that it will serve two purposes from web pages setup to point to it;
    1) To add records to the main database with dropdowns. Certain data will be shown depending on the dropdown selected.
    2) To show a data-only details screen.
    The data is complicated survey data and it was decided that the main table would store the variables and the sub tables would store the constants (Between 2 to 6 records) using the ID to link them.
    e.g.
    Name = Main table.name
    Address = Main table.address
    Position = Table 2.position
    Department = Table 2.Department
    etc...
    Have tried the AND statement above but the system just times out.
    Would it be easier to create multiple recordsets (15 recordsets of 1 main table and 1 sub table) and link it somehow to the cust_id? If so, how would I best set each up so only the relevant fields are pulled from the sub table for each recordset? Or am I being to adventerous and should I just give up and flatten the tables to 1 single table?
    Am starting to thin up top with this one! lol!

  • Recordsets with multiple options - AND, OR If Else and the "Any" Rule

    Hi,
    Been trying to get this to work for days now... I have a form with drop down lists that feeds through variables to a search page... The Recordset Jobsearch2 shown below works great so long as a user chooses and option that has info in the DB.... ie all fields must be present. I cannot seem to work out how to achieve and Any rule?...
    I have had 2 options suggested to me...
    a) the code below...
    if(isset($searchsector) && $searchsector !== "") {
    $query_jobsearch2 .= ' AND Sector LIKE "%' . mysql_real_escape_string($searchsector) . '%"';
    putting this in for each option..... but If Im told I have to add this in before the "$jobsearch2 = mysql_query" line... but when I do this the recordset disappears\is deleted...
    b) Using an Array and "Implode" -  this wouldbe great I'm sure if I had any clue how to do this and what it meant.
    MY CURRENT CODE
    <?php require_once('Connections/steelbakercouk_473245_db1.php'); ?>
    <?php
    $searchsector = $_POST['Sector'];
    $searchlocation = $_POST['clocation'];
    $searchmin = $_POST['minsalary'];
    $searchmax = $_POST['maxsalary'];
    $searchtype = $_POST['Type'];
    ?>
    <?php
    mysql_select_db($database_steelbakercouk_473245_db1, $steelbakercouk_473245_db1);
    $query_jobsearch2 = "SELECT jobs.clocation, jobs.Ref_id, jobs.RefCode, jobs.jobtitle, jobs.blurb, jobs.Consultant, jobs.Salary, jobs.tlocation, jobs.Sector, jobs.Type FROM jobs WHERE jobs.Salary BETWEEN '$searchmin' AND '$searchmax' AND clocation = '$searchlocation' AND jobs.Sector  = '$searchsector' AND jobs.Type = '$searchtype'";
    $jobsearch2 = mysql_query($query_jobsearch2, $steelbakercouk_473245_db1) or die(mysql_error());
    $row_jobsearch2 = mysql_fetch_assoc($jobsearch2);
    $totalRows_jobsearch2 = mysql_num_rows($jobsearch2);
    ?>
    Please help... ... pulling my hair out!
    Thanks

    Ok.. I've tried all methods and still not getting anywhere..
    David... following the link you gave me... and to the letter.. apart from GetSQLValueString()which does not seem to exist.
    All it does is return all the records (as per the basic recordset)
    Heres the code.... please please tell me where I am going wrong.... downloaded your book Foundation PHP but struggaling.,
    <?php require_once('Connections/steelbakercouk_473245_db1.php'); ?>
    <?php
    $searchsector = $_POST['Sector'];
    $searchlocation = $_POST['clocation'];
    $searchmin = $_POST['minsalary'];
    $searchmax = $_POST['maxsalary'];
    $searchtype = $_POST['Type'];
    $any = $_POST['any'];
    ?>
    <?php
    $currentPage = $_SERVER["PHP_SELF"];
    mysql_select_db($database_steelbakercouk_473245_db1, $steelbakercouk_473245_db1);
    $expected = array('Sector' => 'text',
                      'clocation'         => 'text',
                      'minsalary'          => 'int',
                      'maxsalary'      => 'int');
    $query_jobsearch2 = "SELECT jobs.clocation, jobs.Ref_id, jobs.RefCode, jobs.jobtitle, jobs.blurb, jobs.Consultant, jobs.Salary, jobs.tlocation, jobs.Sector, jobs.Type FROM jobs";
    $where = false;
    // Loop through the associatiave array of expected search values
    foreach ($expected as $var => $type) {
      if (isset($_GET[$var])) {
        $value = trim(urldecode($_GET[$var]));
        if (!empty($value)) {
          // Check if the value begins with > or <
          // If so, use it as the operator, and extract the value
          if ($value[0] == '>' || $value[0] == '<') {
            $operator = $value[0];
            $value = ltrim(substr($value, 1));
          } elseif (strtolower($type) != 'like') {
            $operator = '=';
          // Check if the WHERE clause has been added yet
          if ($where) {
            $query_search .= ' AND ';
          } else {
            $query_search .= ' WHERE ';
            $where = true;
          // Build the SQL query using the right operator and data type
          $type = strtolower($type);
          switch($type) {
            case 'like':
              $query_search .= "`$var` LIKE " . GetSQLValueString('%' .
    $value . '%', "text");
              break;
            case 'int':
            case 'double':
            case 'date':
              $query_search .= "`$var` $operator " .
    GetSQLValueString($value, "$type");
              break;
            default:
            $query_search .= "`$var` = " . GetSQLValueString($value,
    "$type");
    $jobsearch2 = mysql_query($query_jobsearch2, $steelbakercouk_473245_db1) or die(mysql_error());
    $row_jobsearch2 = mysql_fetch_assoc($jobsearch2);
    $totalRows_jobsearch2 = mysql_num_rows($jobsearch2);
    $queryString_jobsearch2 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_jobsearch2") == false &&
            stristr($param, "totalRows_jobsearch2") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_jobsearch2 = "&" . htmlentities(implode("&", $newParams));
    $queryString_jobsearch2 = sprintf("&totalRows_jobsearch2=%d%s", $totalRows_jobsearch2, $queryString_jobsearch2);
    ?>

  • Default value in recordset variable

    Hi,
    I am using Dreamweaver 8.
    I am not sure that I understand the function of the default
    value in the variable area of the recordset. I'm using a search box
    and sending the result on through the url. If the person types
    something that is not in either of the two fields searched, is the
    default value supposed to kick in? I have tried entering a value of
    something that is actually in the field, but get a broken image
    (x)...I'm displaying images.
    What I would actually do is to display an error message on a
    different page. Is there a SQL statement that could be put after
    the search statement such &quot;if not....go to url or
    something&quot;? If not, I was thinking of creating a blank
    image with wording stating that there was no match.
    Current recordset code:
    SELECT*
    FROM images
    WHERE description LIKE %colname% OR picturenum = colname2
    ORDER BY picturenum ASC
    Name:colname
    Type:Text
    Default Value: montana (an actual word in the database)
    Run-Time Value: $_GET['description']
    Name:colname2
    Type:Text
    Default Value: A091 (an actual image in the database)
    Run-Time Value: $_GET['description']
    Current code works perfectly thanks to some direction by
    David Powers....thanks David.
    Any help would be appreciated.
    Thanks,
    Cliff

    The best way to accomplish this is to build the WHERE clause dynamically, or else have a different WHERE clause that you use in these situations. In other words, test the value of the querystring variables and if they are empty,  use a different WHERE clause that does not include the address  condition.
    Also, this question belongs in the app dev forum.

  • Updateable recordset from a stored procedure

    I would like to retrieve an updateable recordset from a stored procedure using the oracle 9.2.0.2.0
    oledb provider
    I am using the sample code/tables provided from Oracle.
    Does anyone have an example or has actually created an updatedable recordset from a stored procedure ?

    Assuming your stored procedure is returning a REF CURSOR, it cannot be done. Oracle's REF CURSORS are read only constructs.
    Justin

  • How to get an updatable ADODB Recordset from a Stored Procedure?

    In VB6 I have this code to get a disconnected ADODB Recordset from a Oracle 9i database (the Oracle Client is 10g):
    Dim conSQL As ADODB.Connection
    Dim comSQL As ADODB.Command
    Dim recSQL As ADODB.Recordset
    Set conSQL = New ADODB.Connection
    With conSQL
    .ConnectionString = "Provider=OraOLEDB.Oracle;Password=<pwd>;Persist Security Info=True;User ID=<uid>;Data Source=<dsn>"
    .CursorLocation = adUseClientBatch
    .Open
    End With
    Set comSQL = New ADODB.Command
    With comSQL
    .ActiveConnection = conSQL
    .CommandType = adCmdStoredProc
    .CommandText = "P_PARAM.GETALLPARAM"
    .Properties("PLSQLRSet").Value = True
    End With
    Set recSQL = New ADODB.Recordset
    With recSQL
    Set .Source = comSQL
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
    .LockType = adLockBatchOptimistic
    .Open
    .ActiveConnection = Nothing
    End With
    The PL/SQL Procedure is returning a REF CURSOR like this:
    PROCEDURE GetAllParam(op_PARAMRecCur IN OUT P_PARAM.PARAMRecCur)
    IS
    BEGIN
    OPEN op_PARAMRecCur FOR
    SELECT *
    FROM PARAM
    ORDER BY ANNPARAM DESC;
    END GetAllParam;
    When I try to update some values in the ADODB Recordset (still disconnected), I get the following error:
    Err.Description: Multiple-step operation generated errors. Check each status value.
    Err.Number: -2147217887 (80040E21)
    Err.Source: Microsoft Cursor Engine
    The following properties on the Command object doesn't change anything:
    .Properties("IRowsetChange") = True
    .Properties("Updatability") = 7
    How can I get an updatable ADODB Recordset from a Stored Procedure?

    4 years later...
    I was having then same problem.
    Finally, I've found how to "touch" the requierd bits.
    Obviously, it's hardcore, but since some stupid at microsoft cannot understand the use of a disconnected recordset in the real world, there is no other choice.
    Reference: http://download.microsoft.com/downlo...MS-ADTG%5D.pdf
    http://msdn.microsoft.com/en-us/library/cc221950.aspx
    http://www.xtremevbtalk.com/showthread.php?t=165799
    Solution (VB6):
    <pre>
    Dim Rst As Recordset
    Rst.Open "select 1 as C1, '5CHARS' as C5, sysdate as C6, NVL(null,15) as C7, null as C8 from DUAL", yourconnection, adOpenKeyset, adLockBatchOptimistic
    Set Rst.ActiveConnection = Nothing
    Dim S As New ADODB.Stream
    Rst.Save S, adPersistADTG
    Rst.Close
    Set Rst = Nothing
    With S
    'Debug.Print .Size
    Dim Bytes() As Byte
    Dim WordVal As Integer
    Dim LongVal As Long
    Bytes = .Read(2)
    If Bytes(0) <> 1 Then Err.Raise 5, , "ADTG byte 0, se esperaba: 1 (header)"
    .Position = 2 + Bytes(1)
    Bytes = .Read(3)
    If Bytes(0) <> 2 Then Err.Raise 5, , "ADTG byte 9, se esperaba: 2 (handler)"
    LongVal = Bytes(1) + Bytes(2) * 256 ' handler size
    .Position = .Position + LongVal
    Bytes = .Read(3)
    If Bytes(0) <> 3 Then Err.Raise 5, , "ADTG, se esperaba: 3 (result descriptor)"
    LongVal = Bytes(1) + Bytes(2) * 256 ' result descriptor size
    .Position = .Position + LongVal
    Bytes = .Read(3)
    If Bytes(0) <> 16 Then Err.Raise 5, , "ADTG, se esperaba: 16 (adtgRecordSetContext)"
    LongVal = Bytes(1) + Bytes(2) * 256 ' token size
    .Position = .Position + LongVal
    Bytes = .Read(3)
    If Bytes(0) <> 5 Then Err.Raise 5, , "ADTG, se esperaba: 5 (adtgTableDescriptor)"
    LongVal = Bytes(1) + Bytes(2) * 256 ' token size
    .Position = .Position + LongVal
    Bytes = .Read(1)
    If Bytes(0) <> 6 Then Err.Raise 5, , "ADTG, se esperaba: 6 (adtgTokenColumnDescriptor)"
    Do ' For each Field
    Bytes = .Read(2)
    LongVal = Bytes(0) + Bytes(1) * 256 ' token size
    Dim NextTokenPos As Long
    NextTokenPos = .Position + LongVal
    Dim PresenceMap As Long
    Bytes = .Read(3)
    PresenceMap = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(2)), 2))
    Bytes = .Read(2) 'ColumnOrdinal
    'WordVal = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(bytes(1)), 2))
    'Aca pueden venir: friendly_columnname, basetable_ordinal,basetab_column_ordinal,basetab_colname
    If PresenceMap And &H800000 Then 'friendly_columnname
    Bytes = .Read(2) 'Size
    LongVal = Bytes(0) + Bytes(1) * 256 ' Size
    .Position = .Position + LongVal * 2 '*2 debido a UNICODE
    End If
    If PresenceMap And &H400000 Then 'basetable_ordinal
    .Position = .Position + 2 ' 2 bytes
    End If
    If PresenceMap And &H200000 Then 'basetab_column_ordinal
    .Position = .Position + 2 ' 2 bytes
    End If
    If PresenceMap And &H100000 Then 'basetab_colname
    Bytes = .Read(2) 'Size
    LongVal = Bytes(0) + Bytes(1) * 256 ' Size
    .Position = .Position + LongVal * 2 '*2 debido a UNICODE
    End If
    Bytes = .Read(2) 'adtgColumnDBType
    'WordVal = Val("&H" & Right$("0" & Hex$(Bytes(0)), 2) & Right$("0" & Hex$(bytes(1)), 2))
    Bytes = .Read(4) 'adtgColumnMaxLength
    'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
    Bytes = .Read(4) 'Precision
    'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
    Bytes = .Read(4) 'Scale
    'LongVal = Val("&H" & Right$("0" & Hex$(Bytes(3)), 2) & Right$("0" & Hex$(Bytes(2)), 2) & Right$("0" & Hex$(Bytes(1)), 2) & Right$("0" & Hex$(Bytes(0)), 2))
    Dim ColumnFlags() As Byte, NewFlag0 As Byte
    ColumnFlags = .Read(1) 'DBCOLUMNFLAGS, First Byte only (DBCOLUMNFLAGS=4 bytes total)
    NewFlag0 = ColumnFlags(0)
    If (NewFlag0 And &H4) = 0 Then 'DBCOLUMNFLAGS_WRITE (bit 2) esta OFF
    'Lo pongo en ON, ya que quiero escribir esta columna LOCALMENTE en el rst DESCONECTADO
    NewFlag0 = (NewFlag0 Or &H4)
    End If
    If (NewFlag0 And &H8) <> 0 Then 'DBCOLUMNFLAGS_WRITEUNKNOWN (bit 3) esta ON
    'Lo pongo en OFF, ya que no me importa si NO sabes si se puede updatear no, yo lo se, no te preocupes
    'ya que quiero escribir esta columna LOCALMENTE en el rst DESCONECTADO
    NewFlag0 = (NewFlag0 And Not &H8)
    End If
    If (NewFlag0 And &H20) <> 0 Then 'DBCOLUMNFLAGS_ISNULLABLE (bit 5) esta OFF
    'Lo pongo en ON, ya que siendo un RST DESCONECTADO, si le quiero poner NULL, le pongo y listo
    NewFlag0 = (NewFlag0 Or &H20)
    End If
    If NewFlag0 <> ColumnFlags(0) Then
    ColumnFlags(0) = NewFlag0
    .Position = .Position - 1
    .Write ColumnFlags
    End If
    .Position = NextTokenPos
    Bytes = .Read(1)
    Loop While Bytes(0) = 6
    'Reconstruyo el Rst desde el stream
    S.Position = 0
    Set Rst = New Recordset
    Rst.Open S
    End With
    'TEST IT
    On Error Resume Next
    Rst!C1 = 15
    Rst!C5 = "MUCHOS CHARS"
    Rst!C7 = 23423
    If Err.Number = 0 Then
    MsgBox "OK"
    Else
    MsgBox Err.Description
    End If
    </pre>

  • RecordSet  to Cusror Conversion Help Needed

    Hi,
    I have a Perl Code which calls a Stored Procedure in Oracle 8i Database. As you know that you can return Cursors
    and other data types back to Perl and not RecordSets. So I am trying to convert a RecordSet to a Cursor. The Stored
    Procedure Does some complex computations and then stores the results in a record Set. I need to tansfer the data
    from the Record Set back to the Perl Code via a REF Cusror. The only solution that I can think of is Creating a Temp
    Table to store the results and then point a Cursor to that and return that Cusror to the Perl Code. Is there any other
    way of doing this???. I searched lot of sites/forums, But couldnt find any solution.
    You Help will be greatly appreciated :).
    Thanks
    Rajesh

    Hi Rajesh,
    i too had the same requirement but using Java Code.
    One way to return a Cursor to the code is using a package.
    the query which returns the recordset is to be assigned to a ref cursor. For eg.
    CREATE OR REPLACE PACKAGE PKG_PLAN AS
    TYPE RESULT IS REF CURSOR;
    PROCEDURE USERDETAILS2 (
    O_RESULT OUT RESULT
    END PKG_PLAN;
    CREATE OR REPLACE PACKAGE BODY PKG_PLAN AS
    PROCEDURE USERDETAILS2(
                   O_RESULT OUT RESULT
    AS
    BEGIN
    OPEN O_RESULT FOR SELECT DISTINCT US_FIRSTNAME AS UserName,
    US_COMPANYNAME AS Company, TBLUSER.US_PRIMARYEMAIL AS EmailId ,
    FROM
    TBLUSER where
    TBLUSER.US_STATUS = 'A' ORDER BY UserName;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('INSIDE EXCEPTION');
    END USERDETAILS2;
    END PKG_PLAN;
    and in the perl code u will invoke the procedure as
    CALL PKG_PLAN.USERDETAILS2(?)
    where ? is the out parameter -of type cursor which is to be
    registered via perl code.(not sure how it is done in perl)
    and after issuing execute command via perl code
    get the resultset.
    hope u understood it and the above was of help.
    Good luck
    Rani
    Hi,
    I have a Perl Code which calls a Stored Procedure in Oracle 8i Database. As you know that you can return Cursors
    and other data types back to Perl and not RecordSets. So I am trying to convert a RecordSet to a Cursor. The Stored
    Procedure Does some complex computations and then stores the results in a record Set. I need to tansfer the data
    from the Record Set back to the Perl Code via a REF Cusror. The only solution that I can think of is Creating a Temp
    Table to store the results and then point a Cursor to that and return that Cusror to the Perl Code. Is there any other
    way of doing this???. I searched lot of sites/forums, But couldnt find any solution.
    You Help will be greatly appreciated :).
    Thanks
    Rajesh

  • How to change recordset bahaviour to accept dynamic column names in the where clause

    Hi
    im using php-mysql and i make a recordset and i want to make the column names in the where clause to be dynamic like
    "select id,name from mytable where $tablename-$myvar";
    but when i do this my i break the recordset and it disappear
    and when i use variables from advanced recordset it only dynamic for the value of the column not for the column name
    and when i write the column name to dynamic as above by hand it truns a red exclamation mark on the server behaviour panel
    so i think the only way is to change the recordset behaviour is it? if so How to make it accept dynamic column names?
    thanks in advance.

    As bregent has already explained to you, customizing the recordset code will result in Dreamweaver no longer recognizing the server behavior. This isn't a problem, but it does mean that you need to lay out your dynamic text with the Bindings panel before making any changes. Once you have changed the recordset code, the Bindings panel will no longer recognize the recordset fields.
    Using a variable to choose a column name is quite simple, but you need to take some security measures to ensure that the value passed through the query string isn't attempting SQL injection. An effective way of doing this is to create an array of acceptable column names, and check that the value matches.
    // create array of acceptable values
    $valid = array('column_name1', 'column_name2', 'column_name3');
    // if the query string contains an acceptable column name, use it
    if (isset($_GET['colname']) && in_array($_GET['colname'], $valid)) {
      $col = $GET['colname'];
    } else {
      // set a default value if the submitted one was invalid
      $col = 'column_name1'
    You can then use $col directly in the SQL query.

  • Not able to retrive the recordset from oracle stored procedure in VC++

    Hi,
    I am trying to retrieve the records from the reference cursor which is an out parameter for an oracle 9i store procedure in VC++ application. But it is giving the record count as -1 always. Meanwhile i am able to get the required output in VB application from the same oracle 9i store procedure .
    Find the code below which i used.
    Thanks,
    Shenba
    //// Oracle Stored Procedure
    <PRE lang=sql>CREATE OR REPLACE
    PROCEDURE GetEmpRS1 (p_recordset1 OUT SYS_REFCURSOR,
    p_recordset2 OUT SYS_REFCURSOR,
    PARAM IN STRING) AS
    BEGIN
    OPEN p_recordset1 FOR
    SELECT RET1
    FROM MYTABLE
    WHERE LOOKUPVALUE > PARAM;
    OPEN p_recordset2 FOR
    SELECT RET2
    FROM MYTABLE
    WHERE LOOKUPVALUE >= PARAM;
    END GetEmpRS1;</PRE>
    ///// VC++ code
    <PRE lang=c++ id=pre1 style="MARGIN-TOP: 0px">ConnectionPtr mpConn;
    _RecordsetPtr pRecordset;
    _CommandPtr pCommand;
    _ParameterPtr pParam1;
    //We will use pParam1 for the sole input parameter.
    //NOTE: We must not append (hence need not create)
    //the REF CURSOR parameters. If your stored proc has
    //normal OUT parameters that are not REF CURSORS, you need
    //to create and append them too. But not the REF CURSOR ones!
    //Hardcoding the value of i/p paramter in this example...
    variantt vt;
    vt.SetString("2");
    m_pConn.CreateInstance (__uuidof (Connection));
    pCommand.CreateInstance (__uuidof (Command));
    //NOTE the "PLSQLRSet=1" part in
    //the connection string. You can either
    //do that or can set the property separately using
    //pCommand->Properties->GetItem("PLSQLRSet")->Value = true;
    //But beware if you are not working with ORACLE, trying to GetItem()
    //a property that does not exist
    //will throw the adErrItemNotFound exception.
    m_pConn->Open (
    bstrt ("Provider=OraOLEDB.Oracle;PLSQLRSet=1;Data Source=XXX"),
    bstrt ("CP"), bstrt ("CP"), adModeUnknown);
    pCommand->ActiveConnection = m_pConn;
    pParam1 = pCommand->CreateParameter( bstrt ("pParam1"),
    adSmallInt,adParamInput, sizeof(int),( VARIANT ) vt);
    pCommand->Parameters->Append(pParam1);
    pRecordset.CreateInstance (__uuidof (Recordset));
    //NOTE: We need to specify the stored procedure name as COMMANDTEXT
    //with proper ODBC escape sequence.
    //If we assign COMMANDTYPE to adCmdStoredProc and COMMANDTEXT
    //to stored procedure name, it will not work in this case.
    //NOTE that in the escape sequence, the number '?'-s correspond to the
    //number of parameters that are NOT REF CURSORS.
    pCommand->CommandText = "{CALL GetEmpRS1(?)}";
    //NOTE the options set for Execute. It did not work with most other
    //combinations. Note that we are using a _RecordsetPtr object
    //to trap the return value of Execute call. That single _RecordsetPtr
    //object will contain ALL the REF CURSOR outputs as adjacent recordsets.
    pRecordset = pCommand->Execute(NULL, NULL,
    adCmdStoredProc | adCmdUnspecified );
    //After this, traverse the pRecordset object to retrieve all
    //the adjacent recordsets. They will be in the order of the
    //REF CURSOR parameters of the stored procedure. In this example,
    //there will be 2 recordsets, as there were 2 REF CURSOR OUT params.
    while( pRecordset !=NULL ) )
    while( !pRecordset->GetadoEOF() )
    //traverse through all the records of current recordset...
    long lngRec = 0;
    pRecordset = pRecordset->NextRecordset((VARIANT *)lngRec);
    //Error handling and cleanup code (like closing recordset/ connection)
    //etc are not shown here.</PRE>

    It can be linked to internal conversion. In some case, the value of internal or extranal value is not the same.
    When you run SE16 (or transaction N), you have in option mode the possibility to use the exit conversion or not.
    Christophe

  • Help with multiple recordsets and pulling an ID value (ASP)

    I started this discussion when first developing my project and posted on the General Tab.  I have figured out that issue (trying to get my Insert to work in ASP) but now am having trouble retrieving an ID value.  It should be simple.  I want to insert a new record into a single table and want to create a unique ID field.  I am using SQL Server and tried the Identity setting but won't be able to have admin privileges which are required to set the ID.  So, I'd like to just take the ID value from the last record and just add '1' to it to get a new unique ID manually. My INSERT portion was working, so I just decided to query the records to retrieve the last CatalogID and add '1' to get my new ID.  But it's not working!  I tried opening both a command and a recordset, but get various errors on invalid command use. 
    Any help would be great!  I'm new to all of this!
    I've posted a code snippet of what I thought I should do:
    <%LANGUAGE = “VBSCRIPT” CODEPAGE=”65001”%)
    <!--#include file=”Connections/CapConnect.asp”” -->
    <%
    If (Cstr(Request(“MM_insert”)) = “form1”) Then
                    Dim MM_editCmd
                    Dim MM_Lookup
                    Dim NextCatalogID
                    Set MM_Lookup = Server.CreateObject (“ADOB.Recordset”)
                    MM_Lookup.ActiveConnection = MM_CapConnect_STRING
                    MM_Liikup.Source = “Select CatalogID From dbo.tblCatalogItems ORDERBY CatalogID Ascending”
                    MMLookup.Open
                    MM_Lookup.MoveLast
                    NextCatalogID = MM_Lookup.Fields(“CatalogID”) + 1   'this is supposed to be my new ID value
                    Set MM_Lookup = Nothing
                    Set MM_editCmd = Server.CreateObject(“ADOB.Command”)
                    MM_editCmd.ActiveConnection = MM_CapConnect_STRING
                    MM_editcmd.CommandText = “INSET INTO dbo.tblCatalogItems (CatalogID, ModelName, Description, POCName, [POCPhone]) VALUES (NextCatalogID, ?,?,?,?)
                    MM_editcmd.Prepared = True
                    MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param2”, 202, 1, 100, Request.Form(“modelname”) )
                  MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param3”, 202, 1, 300, Request.Form(“Description”) )
    [Subject line edited by moderator to add server model]

    Ok, you've got lots of problems. First, explain again why you are not able to modify the CatologID to be an identity column? What is the datatype of that column now?
    Next, you are going about selecting your recordset incorrectly. If you are just looking for the last value inserted, there is no need to return all values to the recordset. Just select the max value:
    MM_Liikup.Source = “Select MAX (CatalogID) From dbo.tblCatalogItems”
    Next, you have a typo in your insert statement "“INSET INTO" should be "INSERT INTO"
    Next, your CommandText is wrong. There is no ending quote, and NextCatalogID will be treated as a string literal, not a variable. Use a ? placeholder for it and use the CreateParameter method to populate it.
    Next, your command text includes 4 placeholder, but you are only populating 2.
    But even when you get this to work it will be problematic. What happens when 2 users execute this at the same time? They both read the same value for the max record and increment by one, but the first will succeed and the second will fail. That's why it is always better to use an auto increment (Identity) column.

  • Function return value == -10. Native error code -2146824584 ADOBD.Recordset: Operation is not allowed when object is closed

    I want to call Stored Procedure that return records and output parameter, from CVI
    I can get output parrameter but when I want to get records stream I recieve following wrror:
    function return value == -10. Native error code -2146824584 ADOBD.Recordset: Operation is not allowed when object is closed

    in Stored procedure I create table variable and and insert into string values
    when I remove usage of table variable the error desappear

  • How to determine whether a recordset is Empty or not ?

    Please see my snippet code below :
    <%     
         String sql="";
         String username="CDS";
         try
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con = DriverManager.getConnection("jdbc:odbc:Employees","","");
                Statement stmt = con.createStatement();
                ResultSet rs=null;
                   sql = "Select * from Employee where code='" + username + "'";
                   rs = stmt.executeQuery(sql);
                   rs.next();
                   if (rs==null)
                   %>
                        <jsp:forward page="Login.jsp?msg=Username not recognized"></jsp:forward>     
                   <%     
                else
                   %>
                        <jsp:forward page="Login.jsp?msg=Halo"></jsp:forward>
                   <%
              catch(ClassNotFoundException e)
                   out.println("Driver not found");
                    catch(SQLException e2)
                            out.println(e2.getMessage());
                            out.println("<BR>");
                            out.println("Wrong SQL Statement");
                            out.println("<BR>");
                            out.println(sql);
                            out.println("<BR>");
         %>How to determine whether a recordset has no result ?
    From the above code, i use if (rs==null) and that's not worked.
    Help me, guys.

    ResultSet rs = stmt.executeQuery(sql);
    if (rs.next()) {
    %>
        <jsp:forward page="Login.jsp?msg=Halo"/>
    <%
    } else {
    %>
        <jsp:forward page="Login.jsp?msg=Username not > recognized"/>
    <%
    }

  • How to send php email using email from recordset?

    Hi
    I know the headers to use for php mail(), and I use it for
    the contact form for my viewers in order to contact the directory
    listing's email address ( of which I have hidden by using the words
    'Email Us' and use the id to carry through to the form).
    I have sucessfully used the $to = [email protected] but when I
    want to use the $row_?['email'] it will not send.
    Any suggestions? I use a recordset to retrieve the id of the
    listing to the contact form.
    I will want to follow the same procedure for my jobseekers to
    contact employers job adverts.
    Thanks
    Theresa

    Hi,
    There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
    Moderator edit: Link removed
    Thanks
    Edited by: PhHein on 20.10.2010 16:11

Maybe you are looking for

  • Can't Send Emails From Gmail account on iPhone

    Everytime I try to send an email from my gmail account on my phone it says "The connection to the outgoing server "smtp.gmail.com" failed. Additional Outgoing Mail Servers can be configired in Settings>Mail,Contacts,Calendars."

  • textarea /textarea problem!

    Hi! This might seem simple enough but I can't seem to figure it out: I have written a form in a jsp-page. In the there are a couple of fields and a textarea, i'm using the method post. The thing is that when i process the form-input all the carriage

  • How to get a single particle image after particle analysis in vision development toolkit

    Hi all, After a long time I am here again to find out some solutions regarding image processing. I have an RGB image with a number of particles in it. For processing I have made it binary image and then particle analysis function is used. It is showi

  • Resolution Change When I am Using "Edit a copy with lightroom adjustment"

    Hi Guys, I am using the latest version of lightroom and I have been trying to fix the error that lightroom made. 1. I open most of my photos (resolution 300dpi) on lightroom to do some adjustment 2. I am using "Edit with photoshop CS3" to continuemy

  • I can't identify a hot spot

      I hope someone can help me.   I have a msi nf 980 g65.  I have a cupid HW Monitor. On this it has three temperatures under the fintek sensors. Tempi0, Tempin1 and tempin2. Temp 1 is 90c . I get this temp as soon as I start the computer. My computer