Try this out, hope this works if not will look for other options.
i am converting stored procedures in sql server 2005 to oracle 8i.
In one of the procedure they are using an insert statement which calls another stored procedure..
how can i convert this to oracle 8i..
I have the following stored procedure that works except that the "print" does display on the page when the "IF" condition is met...it shows up as a message when run from Query analyzer but not when the stored procedure is called.
Can anyone tell me what is wrong with my print? I have tried a few things with no success just errors. the solutions I saw in books online did not work for me.
here is the stored procedure:
@ticketid as varchar(20)
Declare @Technician as varchar (40)
declare @count int
set @count=(Select count(*) from job_ticket WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20))
and status_type_id like '[1-2]')
if @count =0 print 'there are no open tickets'
set @Technician=(SELECT email
FROM dbo.tech INNER JOIN dbo.job_ticket ON tech.client_id =
job_ticket.assigned_tech_id WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20)))
SELECT job_ticket.job_ticket_id, job_ticket.question_text 'Report', 'Ticket Number', @Technician
'Technician Assigned',job_ticket.subject 'Issue Description',
report_date 'Open Date'
FROM job_ticket WHERE job_ticket.job_ticket_id =Cast
(@ticketid as varchar (20)) and status_type_id like '[1-2]'
I have solved the problem of how to bind a DataSet to the BindingNavigator control thanks to those who guided me in the right direction.
I now have another problem that is causing me ulcers.
When I populate the DataSet with data I retrieved from some table. I have no trouble using the move next, move previous, move first and move last buttons on the BindingNavigator control. I can navigate from record to record with no problem.
When I try to add a new record into the dataset using the routine written below; two problems occur. 1 – The auto increment ID number goes from 5(the last record ID in the Dataset) to 7. What happened to 6? 2 – After I add the new record’s data; when I page back through the dataset’s records the new record I just added has the record ID of 7. When I move to the previous record 6 (the one that was skipped) I see the data for the first record in the dataset. Records 5 to 2 seem to be correct, but record 1 is empty.
Logic dictates when I add a new record to the dataset it is added at the end of the dataset. This doesn’t seem to be happening. What I plan on doing is after I update the Dataset I will use the DataAdapter to write the changes back to the SQL Sever database, but the dataset looks incorrect, so I won’t commit an update until I’m sure the dataset’s information is correct.
A corollary to this problem is when I try to add records to an empty dataset. I get the DBNull error.
Does anyone know how to add a new record to: 1) an existing dataset, or 2) an empty one?
Private Sub New_Bindings(ByVal intOrdinal As Integer, _
ByVal strCode As String, _
ByVal strName As String)
Dim tblBindings As DataTable
tblBindings = MyDataSet.Tables("tblBindings")
Dim drCurrent As DataRow
drCurrent = tblBindings.NewRow
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
I have dropdownlist named ddlapplication in my web form. When I click any item it insert
that record in database with primary key and show in gridview.
If user try to add the same record next time by clicking same item from the dropdown list
which already exist in database it should show error message that this
record alredy exist or in other words before inserting it should check wheather the record is already in database or not.