Sponsored Content
Top Forums Shell Programming and Scripting Dynamic update loop query on Sybase database Post 302149935 by Alaeddin on Sunday 9th of December 2007 04:41:38 AM
Old 12-09-2007
Dynamic update loop query on Sybase database

Hello Guys,

I'm new to Shell scripting, and i need someone to help me with this issue:

I'm trying to do a dynamic update query on Sysbase database table using shell script.

Lets say, the Update query is "update Table set id=X" , where X is dynamic value for the loop index.
If the loop is from 1 to 3, the update query have to be for X=1, 2 and 3.

Any advice on how to write that.
Thanks.

- Alaeddin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connect to sybase database using Korn shell script

Hi, Can anyone please give me a script or let me know how to connect to a sybase database and execute a query using Korn shell scripts.Am new to Unix but i need to do this ASAP. Please help. Thanks, Gops (7 Replies)
Discussion started by: bhgopi
7 Replies

2. Shell Programming and Scripting

Print out loop index on the console after executing each sybase DB query

Hello Guys, Well, using shell script, I'm doing loop on DB query as below: isql -Usa -Ptest -I /opt/sybase/interfaces << EOF use testdb go declare @i int select @i = 1 while(@i <= 5) begin Insert into TEST values (@i,"Test","TestDesc") select @i = @i + 1 end go EOF The Issue... (2 Replies)
Discussion started by: Alaeddin
2 Replies

3. Programming

Need help with complex SQL query (Sybase)

Hello, I have three tables. I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist: (1) B.intID = A.intID (2) B.intID != C.intID or (B.intID = C.intID and (C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies

4. Windows & DOS: Issues & Discussions

how to connect to sybase database?

hi, I'd like to connect to a Sybase ASE 12 through a a graphic user interface (GUI) that run on windows and solaris10, because i need to do some querys. The database is running on solaris 10. I'm not an expert using databases, but i know how to use some SQL commands through command line... (3 Replies)
Discussion started by: danin
3 Replies

5. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

6. Shell Programming and Scripting

REINDEXING OF A DYNAMIC DATABASE

REINDEXING A DATABASE Hello, I have a database which in fact is a personal dictionary of a special kind to handle name homophones The structure is as follows: a=b=c=d=e=f This structure is an instruction to the program that whenever it encounters such a set of correlations it should treat them... (2 Replies)
Discussion started by: gimley
2 Replies

7. Programming

Hierarchical Query for Sybase database

Team I am using DBartisan tool for sybase database. I have a table that has below fields Employee_ID,EMP_Name,First_Nm,Last_Nm,Emp_Designation,Employee's_Manager is it possible to retrieve hierarchical data based on below fields Emp_Designation will have Soft Engg,SSE,Team Lead,... (6 Replies)
Discussion started by: Perlbaby
6 Replies

8. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

9. Programming

Sybase ASE - Query Tuning - Need Suggestion

Dear Team Please provide suggestion on below query which is used in Sybase Adaptive Server Enterprise/15.7 (ASE). Query takes more time > 30 Mins to 1 Hr All required indexes are built Can we have any efficient approach to get the data retrieval faster for below query.Any help... (0 Replies)
Discussion started by: Perlbaby
0 Replies

10. Shell Programming and Scripting

Update a database table in a for loop

Im trying to update an informix database table for each occurance of a head_barcode in a file called mw within a for loop please see below - cant get the syntax correct. any help please? for a in `cat /tmp/mw` do sql image - << STOP > /dev/null 2>&1 update doc_table set status =... (4 Replies)
Discussion started by: worky
4 Replies
NDB_INDEX_STAT(1)					       MySQL Database System						 NDB_INDEX_STAT(1)

NAME
ndb_index_stat - NDB index statistics utility SYNOPSIS
ndb_index_stat options DESCRIPTION
ndb_index_stat ... Usage To obtain basic index statistics about a given NDB table, invoke ndb_index_stat as shown here, with the name of the table as the first argument and the name of the database containing this table specified immediately following it, using the --database (-d) option: ndb_index_stat table -d database In this example, we use ndb_index_stat to obtain such information about an NDB table named mytable in the test database: shell> ndb_index_stat -d test mytable table:mytable index:PRIMARY fragCount:4 sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 query cache: valid:1 sampleCount:0 totalBytes:0 times in ms: save: 12.380 sort: 0.001 NDBT_ProgramExit: 0 - OK The --verbose option provides some additional output, as shown here: shell> ndb_index_stat -d test mytable --verbose random seed 1337010518 connected loop 1 of 1 table:mytable index:PRIMARY fragCount:4 sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 read stats query cache created query cache: valid:1 sampleCount:0 totalBytes:0 times in ms: save: 20.766 sort: 0.001 disconnected NDBT_ProgramExit: 0 - OK shell> Options The following table includes options that are specific to the MySQL Cluster ndb_index_stat utility. Additional descriptions are listed following the table. For options common to most MySQL Cluster programs (including ndb_index_stat), see Options Common to MySQL Cluster Programs(1). Table 17.21. ndb_index_stat Options and Variables: MySQL Cluster NDB 7.2 +---------------------------------+--------------------------------------+-------------------------------------+ |Format | Description | Added / Removed | +---------------------------------+--------------------------------------+-------------------------------------+ | | Name of the database containing the | | | --database=name, | table. | All MySQL 5.5 based releases | | | | | | -d | | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Delete index statistics for the | | | --delete | given table, stopping any | All MySQL 5.5 based releases | | | auto-update | | | | previously configured. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Update index statistics for the | | | --update | given table, restarting any | All MySQL 5.5 based releases | | | auto-update | | | | previously configured. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Print the query cache. | | | --dump | | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Perform a number of random range | | | --query=# | queries on first key attr (must be | All MySQL 5.5 based releases | | | int | | | | unsigned). | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Drop any statistics tables and | | | --sys-drop | events in NDB kernel (all statistics | All MySQL 5.5 based releases | | | are | | | | lost) | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create all statistics tables and | | | --sys-create | events in NDB kernel, if none of | All MySQL 5.5 based releases | | | them | | | | already exist | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create any statistics tables and | | | --sys-create-if-not-exist | events in NDB kernel that do not | All MySQL 5.5 based releases | | | already exist. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Create any statistics tables or | | | --sys-create-if-not-valid | events that do not already exist in | All MySQL 5.5 based releases | | | the | | | | NDB kernel. after | | | | dropping any that are invalid. | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Verify that NDB system index | | | --sys-check | statistics and event tables exist. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Do not apply sys-* options to | | | --sys-skip-tables | tables. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Do not apply sys-* options to | | | --sys-skip-events | events. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ | | Turn on verbose output | | | --verbose, | | All MySQL 5.5 based releases | | | | | | -v | | | +---------------------------------+--------------------------------------+-------------------------------------+ | | Set the number of times to perform a | | | --loops=# | given command. Default is 0. | All MySQL 5.5 based releases | +---------------------------------+--------------------------------------+-------------------------------------+ ndb_index_stat statistics options. The following options are used to generate index statistics. They work with a given table and database. They cannot be mixed with ndb_index_stat system options. o --database=name, -d name +--------------------+------------------+ |Command-Line Format | --database=name | +--------------------+------------------+ | | -d | +--------------------+------------------+ | | Permitted Values | | +---------+--------+ | | Type | string | | +---------+--------+ | | Default | [none] | | +---------+--------+ | | Range | .. | +--------------------+---------+--------+ The name of the database that contains the table being queried. o --delete +--------------------+-------------------+ |Command-Line Format | --delete | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Delete the index statistics for the given table, stopping any auto-update that was previously configured. o --update +--------------------+-------------------+ |Command-Line Format | --update | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Update the index statistics for the given table, and restart any auto-update that previously configured. o --dump +--------------------+-------------------+ |Command-Line Format | --dump | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Dump the contents of the query cache. o --query=# +--------------------+------------------------+ |Command-Line Format | --query=# | +--------------------+------------------------+ | | Permitted Values | | +---------+--------------+ | | Type | numeric | | +---------+--------------+ | | Default | 0 | | +---------+--------------+ | | Range | 0 .. MAX_INT | +--------------------+---------+--------------+ Perform random range queries on first key attribute (must be int unsigned). ndb_index_stat system options. The following options are used to generate and update the statistics tables in the NDB kernel. They cannot be mixed with ndb_index_stat statistics options. o --sys-drop +--------------------+-------------------+ |Command-Line Format | --sys-drop | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Drop all statistics tables and events in the NDB kernel. This causes all statistics to be lost. o --sys-create +--------------------+-------------------+ |Command-Line Format | --sys-create | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Create all statistics tables and events in the NDB kernel. This works only if none of them exist previously. o sys-create-if-not-exist +--------------------+---------------------------+ |Command-Line Format | --sys-create-if-not-exist | +--------------------+---------------------------+ | | Permitted Values | | +------------+--------------+ | | Type | boolean | | +------------+--------------+ | | Default | true | | +------------+--------------+ | | Range | .. | +--------------------+------------+--------------+ Create any NDB system statistics tables or events (or both) that do not already exist when the program is invoked. o --sys-create-if-not-valid +--------------------+---------------------------+ |Command-Line Format | --sys-create-if-not-valid | +--------------------+---------------------------+ | | Permitted Values | | +------------+--------------+ | | Type | boolean | | +------------+--------------+ | | Default | true | | +------------+--------------+ | | Range | .. | +--------------------+------------+--------------+ Create any NDB system statistics tables or events that do not already exist, after dropping any that are invalid. o --sys-check +--------------------+-------------------+ |Command-Line Format | --sys-check | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Verify that all required system statistics tables and events exist in the NDB kernel. o --sys-skip-tables +--------------------+-------------------+ |Command-Line Format | --sys-skip-tables | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Do not apply any --sys-* options to any statistics tables. o --sys-skip-events +--------------------+-------------------+ |Command-Line Format | --sys-skip-events | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Do not apply any --sys-* options to any events. o --verbose +--------------------+-------------------+ |Command-Line Format | --verbose | +--------------------+-------------------+ | | -v | +--------------------+-------------------+ | | Permitted Values | | +---------+---------+ | | Type | boolean | | +---------+---------+ | | Default | true | | +---------+---------+ | | Range | .. | +--------------------+---------+---------+ Turn on verbose output. o --loops=# +--------------------+------------------------+ |Command-Line Format | --loops=# | +--------------------+------------------------+ | | Permitted Values | | +---------+--------------+ | | Type | numeric | | +---------+--------------+ | | Default | 0 | | +---------+--------------+ | | Range | 0 .. MAX_INT | +--------------------+---------+--------------+ Repeat commands this number of times (for use in testing). COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 NDB_INDEX_STAT(1)
All times are GMT -4. The time now is 02:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy