Updating or Inserting rows into user tables

This is a multi-part message in MIME format.
--------------ECBAD6544F7DBCA3DEAB1615
Content-Type: multipart/alternative;
 boundary="------------AF3F332C953712C818E4EBFB"


--------------AF3F332C953712C818E4EBFB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Our DBA left, and I've been stuck with having to do his job <bummer>.
Here is the
problem we have a sybase table that we need to modify.  Actually we need
to
add additional rows.  The table looks like this:  The part that we need
to add is
high lighted.

geo    bnum   lnum   ltype  descpath
 ------ ------ ------ ------
--------------------------------------------------
      1      0        0          0  Aurora
      1      1        0          0  UNIX Admins
      1      1        1          0     /dev/cua/1
      1      1        2          1     /dev/cua/2
      1      1        3          1     /dev/cua/3
      1      1        4          3    /dev/cua/4
      2      0        0          0     Norcross
      2      1        0          0    Operations
      2      1        1          0    /dev/cua/1
      2      1        2          1    /dev/cua/2
      2      1        3          1    /dev/cua/3
      2      1         4         3    /dev/cua/4
      7      0         0         0   Main
      7      1         0         0   Operations
      7      1         1         0    /dev/cau/1
      7      1         2         1   /dev/cau/2
      7      1         3         1   /dev/cau/3
      7      1         4         3   /dev/cau/4
How do we update this table;   PLEASE HELP.



--------------AF3F332C953712C818E4EBFB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Our DBA left, and I've been stuck with having to do his job &lt;bummer>.&nbsp;
Here is the
<br>problem we have a sybase table that we need to modify.&nbsp; Actually
we need to
<br>add additional rows.&nbsp; The table looks like this:&nbsp; The part
that we need to add is
<br>high lighted.
<p>geo&nbsp;&nbsp;&nbsp; bnum&nbsp;&nbsp; lnum&nbsp;&nbsp; ltype&nbsp;
descpath
<br>&nbsp;------ ------ ------ ------ --------------------------------------------------
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp; /dev/cua/4
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><font color="#000000">7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp; Main</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp; Operations</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0&nbsp;&nbsp;&nbsp; /dev/cau/1</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp; /dev/cau/2</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp; /dev/cau/3</font></b>
<br><b><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3&nbsp;&nbsp; /dev/cau/4</font></b>
<br>How do we update this table;&nbsp;&nbsp; PLEASE HELP.
<br>&nbsp;
<br>&nbsp;</html>

--------------AF3F332C953712C818E4EBFB--

--------------ECBAD6544F7DBCA3DEAB1615
Content-Type: text/x-vcard; charset=us-ascii;
 name="jpruitt.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for judy pruitt
Content-Disposition: attachment;
 filename="jpruitt.vcf"

begin:vcard 
n:Pruitt;Judy 
tel;pager:888 791-2047
tel;home:770 437-1017
tel;work:770 840-1558
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:jpruitt@checkfree.com
fn:Judy Pruitt
end:vcard

--------------ECBAD6544F7DBCA3DEAB1615--

0
judy
10/12/1999 6:08:35 PM
sybase.sqlserver.admin 2338 articles. 0 followers. Follow

1 Replies
263 Views

Similar Articles

[PageSpeed] 2

judy pruitt wrote:
> 
> Our DBA left, and I've been stuck with having to do his job <bummer>.
> Here is the
> problem we have a sybase table that we need to modify.  Actually we
> need to
> add additional rows.  The table looks like this:  The part that we
> need to add is
> high lighted.
> 
> geo    bnum   lnum   ltype  descpath
>  ------ ------ ------ ------
> --------------------------------------------------
>       1      0        0          0  Aurora
>       1      1        0          0  UNIX Admins
>       1      1        1          0     /dev/cua/1
>       1      1        2          1     /dev/cua/2
>       1      1        3          1     /dev/cua/3
>       1      1        4          3    /dev/cua/4
>       2      0        0          0     Norcross
>       2      1        0          0    Operations
>       2      1        1          0    /dev/cua/1
>       2      1        2          1    /dev/cua/2
>       2      1        3          1    /dev/cua/3
>       2      1         4         3    /dev/cua/4
>       7      0         0         0   Main
>       7      1         0         0   Operations
>       7      1         1         0    /dev/cau/1
>       7      1         2         1   /dev/cau/2
>       7      1         3         1   /dev/cau/3
>       7      1         4         3   /dev/cau/4
> How do we update this table;   PLEASE HELP.

I don't know the name of your table, assuming it is "mytable" and that
geo, bnum, lnum, and ltype are all numeric datatypes
(int/numeric/decimal), you would use a number of insert statements
like this:

insert mytable (geo,bnum,lnum.ltype,dsecpath) values (7,0,0,0,"Main") 

--
Bret Halford 
Sybase Technical Support			
3665 Discovery Drive		
Boulder, CO 80303
0
Bret
10/12/1999 6:44:07 PM
Reply:

Similar Artilces:

Showing table columns from multiple tables in Formview, but insert/update/delete rows of Master table
I have a page on which I have GridView and FomView control. On selection of a row in GridView the row gets displayed in the Item template of the FormVIew. The values are the result of inner join from multiple tables i.e. table Stock,Product and Workshop.  Please let me know how I could insert/update/delete data for the base table i.e. Stock table, but be able to see the column values from the associated tables on the Itemtemplate,Edittemplate and Inserttemplate of the FormView. Thanks,Anita Hi:   Take a look at this tutorial. It's for DetailsView and same ...

Is having a trigger that inserts a row in Table 'A', when a row in same table is inserted by ADo.Net code?
I want to insert a row for a Global user  in Table 'A' whenever ADO.Net code inserts a Local user row into same table. I recommended using a trigger to implement this functionality, but the DBA was against it, saying that stored proecedures should be used, since triggers are unreliable and slow down the system by placing unecessary locks on the table. Is this true OR the DBA is saying something wrong? My thinking is that Microsoft will never include triggers if they are unreliable and the DBA is just wanting to offload the extra DBA task of triggers to the programmer so that a s...

Update a rows in one table for each row in other table
Hello all, i am a newbie in SQL and i want to ask for your help in order to do the following update statement. I have a table tblUsers which holds all the users, one of the fields in their GroupId. In the UserGroup table i have a field "UsersCount" and in that field i want to keep the number of the users in that group. Basically i want everytime i am saving a user to recalculate the users in all usergroups. I am trying to have something like:SELECT User_GroupId, count(User_GroupId) as UsersCount FROM tblUsersWHERE DeletedFlag = 0 GROUP BY User_GroupId and then:"FOR EACH" User_GroupIdUPDAT...

Update row in Table A from row in Table B
Hello, I have 2 tables.... table A and table B. Ok, In a stored procedure, I pass in an int value @ID I want to get the row from Table B WHERE ID =@ID....and then UPDATE the Row in Table A that has the same ID...with the values from table B. Table A ID | Col1 | Col2 ----------------------- 2 a a Table B ID | Col1 | Col2 ----------------------- 2 b b I would like to update A.Col1 with B.Col1 and A.Col2 with B.Col2 Can someone help me out with this syntax? Thanks a lot. update tableA ...

INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
hi all, i have created a temperory table  in sql server 2000. as shown below.   create table #table_AllExceptions     (      ExceptionMessage varchar(1000),   ExceptionSource varchar(1000),   ExeceptionStackTrace varchar(1000),   ExecTargetSite varchar(1000),   ExceptionAdditionalInfo varchar(4000),   ImportFileName varchar(1000)     ) and inserting the values in to temp table  with INSERT INTO #table_AllExceptions EXEC(@Sq...

How can i do a multiple insert or multiple updates or inserts and updates to the same table..
Hi...  I have data that i am getting through a dbf file. and i am dumping that data to a sql server... and then taking the data from the sql server after scrubing it i put it into the production database.. right my stored procedure handles a single plan only... but now there may be two or more plans together in the same sql server database which i need to scrub and then update that particular plan already exists or inserts if they dont...   this is my sproc...  ALTER PROCEDURE [dbo].[usp_Import_Plan] @ClientId int, @UserId int = NULL, @HistoryId int, @ShowS...

Stored Procedure that fetch each row of a table and update rows in another table
I am working with the following two tables: Category(NewID,OldID) Link(CategoryID,BusinessID) All fields are of Integer Type. I need to write a stored procedure in sql 2000 which works as follows: Select all the NewID and OldID from the Category Table (SELECT NewID,OldID FROM Category) Then for each rows fetched from last query, execute a update query in the Link table. For Example, Let @NID be the NewID for each rows and @OID be the OldID for each rows. Then the query for each row should be.. UPDATE Link SET CategoryID=@CID WHERE CategoryID=@OID Please help me ...

I have created a table Table with name as Varchar and id as int. Now i have started inserting the rows like, insert into Table values ('arun',20).
I have created a table Table with name as Varchar and id as int. Now i have started inserting the rows like, insert into Table values ('arun',20).Yes i have inserted a row in the table. Now i have got the values " arun's ", 50.                 insert into Table values('arun's',20)  My sqlserver is giving me an error instead of inserting the row. How will you solve this problem?    The direct answer to your question is: You insert it like this:   ...

Data Controls insert rows into gridview then insert rows from gridview into SQL Table
Hello there, I'm still new at performing miracles with code . Currently I am having trouble with my latest coding adventure I have a web application which records jobs and labour assigned to jobs. The issue in particular I'm having is the way in which labour is to be assigned. I want to use standard controls (Textbox, Dropdownlist) to record the values into a gridview (ie,put multiple rows into the gridview using the controls). Then, when all the inserting is complete, the user clicks a submit button to insert all the rows from the gridview into a database table. The reason for...

Insert values into another table after updating a row
using VS2005, VB.net.  i have a gridview with 5 fields: EventID, EventName, EventLocation, EventRating, & Comments.  when the row is updated, i want the text that was inputted into the EventID & Comments fields to UPDATE the table the gridview is selecting from, but also INSERT INTO another table in my DB.  obviously the update part is easy, but i cant figure out how to fire an INSERT command after the update.  ive seen the event called ROWUPDATED, but have no idea how to use it.  any help would be greatly appreciated. thanks in advance.  ...

sql-Update row in a table 10 days after insertion
 hai all,                    I want to update a row in my table 10 days after insertion of that row..i want it to be done in backend.. any solution     u can use job schedulinghttp://msdn.microsoft.com/en-us/library/ms191439.aspx Thanks,Kamrul Hassanplease mark as answer if it helps u. hai kamar,                     I'm using sqlserver 2000 . is there any other solution raoufk:hai kamar,           &n...

?? On remote
9.0.2.3274 On the remote I insert a row. I then subsequently update that row. All before synchronizing. I don't know what changed, but I don't get my modifications in the consolidated. When I synchronize the remote with the consolidated, the upload_insert event gets fired with the initial insert (non-PK columns with no data) but I do not get the upload_update event to fire with the data I used when I updated the new row on the remote. ??? In this scenario with an insert and then an update, should the upload_insert have the modified data or should there be an up...

Update problem when updating all rows of a table
Hi, I have an application where I'm filling a dataset with values from a table. This table has no primary key. Then I iterate through each row of the dataset and I compute the value of one of the columns and then update that value in the dataset row. The problem I'm having is that when the database gets updated by the SqlDataAdapter.Update() method, the same value shows up under that column for all rows. I think my Update Command is not correct since I'm not specifying a where clause and hence it is using just the value lastly computed in the dataset to update the entire database....

Trigger to Insert Row on Update and Insert
Hi, I'm sure this question has been asked before, but I couldn't find an answer. When a row in TableA is inserted or updated, how can I insert that row into TableB? In other words TableB is like an audit tracking table. I can't figure out how to get the uniqueID of the row in TableA. Many thanks. Chris Why do you need the get the uniqueId of the row?  Regardless, it should already be set and available in the Trigger. However, if the two tables have the exact same fields the Trigger code would simply be Create Trigger trgSomeName On TableA For Insert, Updat...

Web resources about - Updating or Inserting rows into user tables - sybase.sqlserver.admin

Inserting Kate
jurvetson posted a photo: the speaking GPS avatar that we came to love.. more prep photos below... You can hear her voice in the video compilation ...

Inserting the Galaxy Note 5’s S Pen backwards can permanently damage the device
One of the features Samsung highlighted when it unveiled the Galaxy Note 5 was the device's new S Pen slot design. The Note 5 features a spring-loaded ...


Inserting Slavery Into The Climate Debate
Chris Hayes compares the fight against fossil fuels to the abolitionist movement. He states plainly that “there is absolutely no conceivable ...

Samsung smart TVs inserting ads into third-party apps
... playback have pissed off a number of consumers. People with smart TVs from Samsung have been complaining that the electronics maker is inserting ...

Inserting images into Gmail could be so much better
When Google first launched the new compact compose window in Gmail, many of you might have noticed something annoying about inserting images. ...

Gawker tells Steven Crowder to "stop whining, take your licks, and accept that getting hit in the face ...
"... in the middle of an argument between billionaire-funded know-nothing ideologues and people whose livelihoods and stability are being threatened ...

Gmail's Shortcut for Inserting Hyperlinks
... but that doesn't mean Google shouldn't improve them. Many people complained that Gmail's rich text editor doesn't have a shortcut for inserting ...

Why Hollywood Is Inserting These Two Huge Chinese Actresses Into Its Summer Blockbusters
... It shows the enormous potential in China for distributors. We've previously discussed how Hollywood is starting to cater to China by inserting ...

Samsung SmartTVs are inserting ads into movies - Business Insider
Random Pepsi pop-up ads have been appearing when SmartTV users watch content through the device's third-party apps.

Resources last updated: 12/28/2015 10:59:02 PM