|
Well I'm working on something like 4 things at once with 4 hours sleep. I mixed up a few things.
No need for sarcasm.
|
|
|
|
|
I wasn't being sarcastic.
To help with diagnosing a code question one needs to post the code that is the source of the problem.
|
|
|
|
|
It looks as though you are assigning the result of the function call to a variable and the types of the two do not match. The function is going to return a BOOL type and the variable is of type OracleRefCursor.
Not sure if this will work, but instead of ExecuteNonQuery(), would you be able to ExecuteQuery(string) instead and then check the value of the parameter. The parameter should be defined as type BOOL as well.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Thanks Chris!
will doing the ExecuteNonQuery with begin : boolean := 'insert statement' also work?
Michael
|
|
|
|
|
As long as the parameter :boolean is defined as type BOOL, then I think it might.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I should add that we are sending the data as comma delimited strings
Using comma separated strings data can be problematic because some times the data itself may contain a commas so the data string gets parsed incorrectly. Strings such as "NY, NEW YORK, STATE OF" will be parsed incorrectly. I suggest you use pipes (|) to separate data elements for example "NY|NEW YORK, STATE OF".
If you can get the data in Excel, you can quickly create a CSV that uses a pipe delimiter(sounds like an Oxymoron..). To change Excel such that it uses a pipe instead of a comma in CSV files, go to Control Panel, Regional and Language Options,Click Customize, then change the list separator value to | (from a ,). So when you save files in Excel as CSV, the data elements will actually be separated by '|' instead of ','. Also, change your parser-whatever that is, to use '|'
|
|
|
|
|
I've been searching the net for this but I couldn't find concrete answer what to use to recover identity ID from INSERT stored procedure.
What is the correct way to get the ID as output in stored procedure (should I use @@IDENTITY, SCOPE_IDENTITY() or something else).
CREATE TABLE [dbo].[tbl_Table](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NULL
)
Thanks,
|
|
|
|
|
|
ty about the article. It really helped.
|
|
|
|
|
No, don't use identities, they're too limiting.
|
|
|
|
|
|
If you start on about guids again I'll scream.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'll need a heads up before you scream. Just to plug my ears.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I figured that might be that persons point.
One problem with guids is that they have no implicit ordering. And some times ordering for implementation needs rather than business needs is a good idea. Not to mention size and convenience.
And of course guids are likely unique but not guaranteed to be so.
|
|
|
|
|
From my personal experience guids may affect the performance significantly if they are used for primary key and are randomly generated. To solve this i've read somewhere that is recommended to use NEWSEQUENTIALID() as default, instead NEWID() to generate keys and with clustered indexes the performances will be much better. However if I use these keys as foreign key in other table this will not help as they will not be ordered, so I choose to use integers for primary key. The idea is MSSQL to generate new id and to return it to object in code, but also I've read there might be some problems with using @@IDENTITY or SCOPE_IDENTITY()
|
|
|
|
|
Igor Jas wrote: I've read there might be some problems with using @@IDENTITY or
SCOPE_IDENTITY()
Reference required, a shot like that requires a reference so we can investigate the veracity of the statement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Igor Jas wrote: However if I use these keys as foreign key in other table this will not help as they will not be ordered
That statement is either incomplete or wrong.
You might want an implementation (not business way) to order data and as such you could use a integer key to do so.
But whether it is a foreign key or not has nothing to do with that.
|
|
|
|
|
jschell wrote: One problem with guids is that they have no implicit ordering
This is 100% incorrect, and one of the arguments FOR guids. Primary key should have absolutely NO intelligence other than to identify the record.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That is one area where you and I seem to agree completely.
|
|
|
|
|
PIEBALDconsult wrote: agree completely
Yeah we have the fundamentals right, just disagree on the details but the thats where the art comes in and art is such a personal thing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Guys, let us agree to disagree...
|
|
|
|
|
Mycroft Holmes wrote: This is 100% incorrect, and one of the arguments FOR guids. Primary key should have absolutely NO intelligence other than to identify the record.
Err...obviously what you quoted is 100% correct.
Guids do not have an ordering.
Integer values do.
That said you might disagree with my assertion that one might need an implicit ordering in a table but that has NOTHING do with what you quoted.
Presumably you are claiming that the need is never possible and can never occur.
I am claiming that sometimes, rarely, it does provide a solution.
|
|
|
|
|
jschell wrote: Err...obviously what you quoted is 100% correct.
No you read correctly, this is a fundamental rule of database design and if you ignore it you will get bitten somewhere down the track. A PK has only 1 job, identify the record. Ordering the data is NOT part of the PKs job, thats up to the designer to implement a specific solution.
This is one of the strongest arguments FOR guids, it stops developers relying on the PK for anthing but record identification, they can't use them for ordering or to identify part of the the record (the old concatenated string from bits of the record trick).
The reson I don't like guids is I can never remember the bloody things when debugging a procedure .
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hear hear!
Mycroft Holmes wrote: I can never remember the bloody things
I use copy-and-paste.
I've also mentioned before that you don't have to use auto-generated GUIDs; you can cobble them up yourself for development and testing purposes.
|
|
|
|
|
Mycroft Holmes wrote: No you read correctly
Nope.
What you quoted had nothing to do with what you then went on to state was wrong.
Mycroft Holmes wrote: No you read correctly, this is a fundamental rule of database design and if you
ignore it you will get bitten somewhere down the track. A PK has only 1 job,
identify the record. Ordering the data is NOT part of the PKs job, thats up to
the designer to implement a specific solution.
And as I said sometimes ordering is required. As you said as well.
From that one then must decide on a way to provide that ordering. And PK integer might be used for that that.
Or not.
The needs of the application, business, project needs, etc define the design.
Not arbitrary rules.
|
|
|
|