accessing row by row

first of all sorry if i posted this in a wrong place but i'm
new to powerbuilder and i have to develop a program quite
quickly ( i only worked with acces until now)

i have been provided a excel spreadsheet that contains all
coloms and rows from all tables wich i have to insert in a
database. The difficulty is that i can't use a datapipeline
because i need to use a string function to check in wich
table i have to put it: TABLENAME_COLUMNNAME -> i thought
about using the string function to find out the right column
in the right database.

however i don't know how you can acces row by row and cell
by cell in powerbuilder so i can extract it in a string.
Could anyone help me with that or give me some advice on a
other way of working?

thanks in advance
Johan
0
Johan
5/17/2005 10:32:41 AM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

1 Replies
788 Views

Similar Articles

[PageSpeed] 34

based on what version of PB you have, there are several ways
to do this.

1) I think there is an Excel odbc option, sorry I have not
sure where I saw this option, So I'm not a 100% sure whats
involved

2) use PB importfile, importstringex or importstring
methods. ( i'm starting to look at) requires a flat file

3) save Excel as CSV or text (tab)  file and use something
like the the code below to read it ( I started with PB4 and
this method was the only method I knew of at the time. )

ll_file_num = FileOpen(as_file_to_open, lineMode!)
ll_record_count = 0

if ll_file_num < 1 then
		FileClose(ll_file_num)
		goto abnormal_end
end if


read_file:

ll_num_chars_read =	FileRead(ll_file_num , ls_record)

if ll_num_chars_read = -100 then  // file at eof
	commit;
	FileClose(ll_file_num )
	goto normal_end
ElseIF (ll_num_chars_read < 1) and & // no data in file
	 (ll_record_count < 2 ) then
	f_error_msg('Could not read file ' + ls_file_name )
	rollback;
	FileClose(ll_file_num )
	goto abnormal_end
.....

process file:
For ll_loop = 1 to len(ls_record)	
   If mid(ls_record,ll_loop,1) = ',' then
     		ll_numb[li_count] = ll_loop
		   li_count = li_count + 1
	End if
	If li_count > 5 then
		exit
	End If
Next

ls_fund_number = trim(MID(ls_record, ll_numb[1]+1,
ll_numb[2]-ll_numb[1]-1))
ld_unit_value = dec(MID(ls_record, ll_numb[4]+1,
ll_numb[5]-ll_numb[4]-1))

not pretty but it works.
-steps I use to load CSV or Text file

1) delete data in import Datawindow  (DW)
2) use above code to read data and parse in to the import DW
3) verify data in import DW ( if needed)
4) use data pipeline to get data from import DW and insert
data into database table.


this method allow me to verify that the data is and looks
good and if there is an issue with the data after step 4 I
can use the import DW to backout only the new imported
records from the data in the database. (until I run the
import again)

> first of all sorry if i posted this in a wrong place but
> i'm new to powerbuilder and i have to develop a program
> quite quickly ( i only worked with acces until now)
>
> i have been provided a excel spreadsheet that contains all
> coloms and rows from all tables wich i have to insert in a
> database. The difficulty is that i can't use a
> datapipeline because i need to use a string function to
> check in wich table i have to put it: TABLENAME_COLUMNNAME
> -> i thought about using the string function to find out
> the right column in the right database.
>
> however i don't know how you can acces row by row and cell
> by cell in powerbuilder so i can extract it in a string.
> Could anyone help me with that or give me some advice on a
> other way of working?
>
> thanks in advance
> Johan
0
TDR
5/17/2005 1:04:43 PM
Reply:

Similar Artilces:

How to access the last row of data and find out how many rows are in that database?
I have a database with one column that has 3 rows with numbers 1, 2, 3. I want to know how to access the last row of the database (which stores the number 3) and find out what number it stores (in this case the number 3). But the goal is so that when I add a new row to the database from aspx page, I will know which number comes next after the last row that is already in the database. Also is there some way to find out how many rows in total the database currently stores. Because when the user is exiting my site I want to find out how many rows there are in total and then subtract 3 from...

(Fwd) How to loop through a database, row by row, and select and update one row at a time
----- Forwarded message from Troy Mulder <mulderta@gmail.com> ----- Date: Mon, 12 Apr 2010 17:48:37 -0400 From: Troy Mulder <mulderta@gmail.com> To: Tim.Bunce@pobox.com Subject: How to loop through a database, row by row, and select and update one row at a time Hello Tim (is it Dr. Bunce?), My name is Troy Mulder, and I am trying to get a perl script to interface with a PostgreSQL database. I am trying to step through each row of the database, and read one column of the row, and update another column of the row. When I follow the online tutorial a...

First Row, Next Row, Prior Row, Last Row
I have a SQL Anywhere 7.0 Database, have a table Product_detail which contains Column Name Datatype width Null Default batch_id char(10) No None prod_id Integer No None employee_id Integer No None quantity Integer No None price Numeric (14, 2) No None Its primary key is batch_id I have a Freeform Datawindow with this table I want to provide the first row, next row, prior row and last row Ho...

ask database on deleting if some row references another row (= database.Can_I_delete_some_table_row?)
Hello, is there way to ask database if I can delete some table row? I have tables with foreign key constraints and I need "try delete" some row in this table. But there is possibilitythat the row is referenced by another table, so it throws an exception.. I now that I can use in my .net code try, catch statement to catch unpossibility of execution sql statement...but It makes me feel that this is "hard" way (throwing exception, catching..) -- maybe here is another more efficient way.. I need do st.like that: IDbConnection connection = Connection;// ask database ...

How do we traverse through the records row-by-row in a database?
Hi guys, I used a CurrencyManager in a windows form to traverse row-by-row on the records in a database. Can anyone help me out in using a similar feature in asp.net to traverse through the records row by row. Is there any in-built feature? I tried using a dataset to traverse through but I think it might be better to use an in-built feature as te code used in it might be optimised. ThanksKarthik MuthuswamyProgrammer AnalystChennai Did you try using a gridview??Click on 'Mark as Answer' if this post is helpful.-- Randy If you want to traverse row by row in the database itse...

Accessing GridView Data Row By Row
guys i have just started with asp.net i have a basic doubt, i have created a SQL datasource and a gridview associated with it now what i need to do is get all the data from my database n modify it further, for this i need to access each row of the gridview any ideas on how to do so? foreach(GridViewRow row in GridViewName.Rows) { you can interate like this..  }Better Post your code before asking some thing, some one. So that person helping u will understand u r problem ClearlyYahoo IM : dotnetrulerI am trying to keep Frequently Asked Questions in my blog  When u enable show...

Deleted row information cannot be accessed through the row.
I have a DataSet in which I need to make multiple changes prior to saving. Here's the scenario where I'm having the problem:1. I delete a row and it disappears from the table.2. I attempt to add another row.3. I receive an error that "Deleted row information cannot be accessed through the row." when the the screen posts back and refreshes.Here's the code for deleting:<code>protected void dgEmail_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Debug.WriteLine("dgEmail_DeleteCommand"); EnableSaveBtn(); dgEmail.EditItemIndex = -1; dsEmail.Tables["...

How to get data from database row by row
I try to get data from a database row by row, I am using DataReader, the return result is not I expected, don't know how to solve it. Here is my sample code: --------------------------------------------Dim commandText As String = "select * from customer "Dim con As New OleDbConnection("Data Source=c:\company.mdb;Persist Security Info=False; Provider=Microsoft.Jet.OLEDB.4.0;")Dim Cmd As New OleDbCommand(commandText, con)Dim reader As OleDbDataReader = Cmd.ExecuteReader()             Using con       &nbs...

Deleted row information cannot be accessed through the row.
I'm getting an exception with the message "Deleted row information cannot be accessed through the row". I have processing the records through the data table. In some situation i have deleted the rows in the datatable and inserting the new rows. These situation i have get the above specified error. Regards, Vijay Hi Vijay, this error occours when u try to access the row which u have already deleted. So, try to check if the row exists or not and then retrieve the information. I hope this will help u..Please mark as Answer if it helps u. Thanks!Parth PatelTechsture Technol...

DataSet rows being deleted, but after the update , the sql database is not updated. The delete rows still in the database.
 Stepping thru the code with the debugger shows the dataset rows being deleted.   After executing the code, and getting to the page presentation. Then I stop the debug and start the page creation process again ( Page_Load ).    The database still has the original deleted dataset rows. Adding rows works, then updating works fine, but deleting rows, does not seem to work.   The dataset is configured to send the DataSet updates to the database. Use the standard wizard to create the dataSet.     cDependChildTA.Fill(cDependChildDs._ClientDependentC...

View severel rows from database in one gridview-row
I have a database with the columns name, day, activity. The content look like this: Peter, monday, work Alice, Thuesday, London Alice, Monday, Holiday  .... I want to show this in a gridview where each person is shown in one row and the columns are the days of the week. The example above should look like this on the screen: name, monday, thuesday, wednesday, thursday,... Peter,work,,,,,, alice,Holiday, London Is that possible ? Thanks Hi:   From your description I think you can use ItemTemplate. First just create this layout. The DataSource only have to select di...

Deleting rows in access database
Hey, I think this question is bugging not only me, but I have not found anything related to it so..listen. The "DELETE" function doenst actually deletes the records, it only puts the property "deleted" on the record, so.....my database file is about 15MB, eventhough I dont have any records on it..... Does anybody know how can I delete those deleted records. I know in FoxPro there is a "PACK" function that cleans the db. Thank you for your help. =] You need to do a "Compact and Repair". Others have posted code for this. Howeve...

retrieving from row # to row #.
I have over 750 000 rows to retrieve from a table using a datawindow, but my system can only handle approx 30 000 rows and I would like to start from the end of the table. Is it possible to set the row numbers to retrieve? For example, start the retrieve from row 750 000 and stop at row 720 000. There must be a way. thanks, Vern what backend are you using? <Vern> wrote in message news:6BA241541AAD7F2F0063357385256C40.0063358685256C40@webforums... > I have over 750 000 rows to retrieve from a table using a datawindow, but > my system can only handle approx 30 ...

adding a blank header row /row above the header row
is it possible to add a blank row above the header row in gridview for adding some links and buttons the links will respond to thae data in the grid and the buttons are for login / regisration etc....  if yes how it can be done or how do i achieve it. Its better that u create a table with a single row with columns matching the GridView columns. Set the table width same as the GridView width. This will make the GridView Look as if there is a row above its header.Please do not forget to click Mark As Answer on the post that helped you. Regards,Iam Srikanth Reddy....

Web resources about - accessing row by row - sybase.powerbuilder.database

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Accessing the Future Fund a sensible proposal, says super expert Daryl Dixon
As portfolios go, the Future Fund's asset allocation is concentrated in higher-risk investment, including equities and alternative assets.

Accessing my Super
I'm 57 - can I access my super?

Australia, US accessing Indonesian telephone data, leaked documents show
Newly disclosed documents from former US intelligence contractor Edward Snowden have revealed that Australian intelligence efforts against Indonesia ...

Euthanasia advocate Philip Nitschke detained at Melbourne Airport, accuses Customs officials of accessing ...
Euthanasia advocate Philip Nitschke has accused Customs officials of accessing hundreds of patients' sensitive records on his laptop after detaining ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 12/5/2015 10:54:36 AM